Understand How to Effectively Use Interfaces


show more An interface (also known as a protocol) is an inventory, or list, of method signatures that are similar in nature to a class, but do not have any functionality, behavior, or actual code written into them. Watch this programming tutorial about using interfaces in order to understand how to use interfaces. show less
please wait ...

Using interfaces

Related to the idea of Inheritance is a concept supported by many object-oriented languages which usually referred to as an interface. Now this can get a little puzzling because the word Interface is heavily used in computing and has several different meanings. But the term here does not mean user interface. What we are talking about here in this discussion is something that's actually created very similar to a class but with no actual functionality, no actual code, no behavior. It's really just a list of method signatures.

In Java an interface would be written something like this, just the word interface instead of class. Give it a name. I am calling it Printable, and then two method signatures with absolutely no functionality, you're not allowed to put functionality inside an interface. Now you might think, well, what's the point of this? Well, the idea is that if we create a new class and then choose to use an interface--and the term we use is implementing an interface--it's li...

Using interfaces
Video duration: 4m 20s 3h 1m Intermediate

Viewers:

An interface (also known as a protocol) is an inventory, or list, of method signatures that are similar in nature to a class, but do not have any functionality, behavior, or actual code written into them. Watch this programming tutorial about using interfaces in order to understand how to use interfaces.

Subject:
Developer
Software:
Java
Author:
please wait ...