Concept of "interface" in Java

The interface keyword is used to create fully abstract classes. The main purpose of an interface is to determine how we can use the class that implements it. The interface creator defines method names, argument lists, and return types, but does not implement their behavior. All methods are implicitly declared as public.

Since Java 8, interfaces are allowed to host the implementation of default methods and static methods.

The interface can also contain fields. In this case, they are automatically public static final.


Read also:


Comments

Popular posts from this blog

Methods for reading XML in Java

XML, well-formed XML and valid XML

ArrayList and LinkedList in Java, memory usage and speed