Java interfaces?

I really need help with the interfaces in general ...

Any resources that you guys would recommend to me?

Connected:

  • How are Java interfaces actually used?
  • Java Interface and Inheritance
  • Guidelines for using the Java interface - are receivers and setters inconvenient in the interface?
  • Why can't I define a static method in the Java interface?
+6
java oop
source share
4 answers

What is an interface? from official java tutorial

Edit: The second resource from the same tutorial is the Interfaces and Inheritance section.

+8
source share

Generally:

You can see the interface as a contract or agreement between the two parties. Therefore, they can evolve independently until the interface changes.

The caller knows what behavior is available, and the executing party knows what to implement.

There are many advantages to using interfaces. One of them is that it’s easy to switch between implementations. Another is that classes can have different (inter) faces without using multiple inheritance.

+5
source share

Perhaps you should take a look at this wonderful book by Bruce Eckel (free in electronic format): Thinking in Java

+3
source share

An interface is similar to a Java class, but it contains only an abstract method and a final attribute. Mostly the interface is used to achieve "polymorphic" behavior.

Here is an example of coding parts

0
source share

All Articles