Interface, implementation, and inheritance
Now, we are stepping into the most significant area of Java programming – the heavily used Java programming terms of interface, implementation, and inheritance.
Interface
In everyday life, the word interface is quite popular. Its meaning is very close to the role Java interface plays in programming. It defines the public face of an object. It describes how it is possible to interact with the object and what can be expected of it. It hides inner class workings and exposes only method signatures with return values and access modifiers. An interface cannot be instantiated. An object of an interface type can be created only by creating an object of a class that implements this interface (interface implementation will be covered more thoroughly in the next section).
For example, look at the following class:
public class MyClass { private int field1; private String field2; public MyClass(int val1, String val2){ this.field1 = val1; this.field2...