Exampleinterface String: Public Interface Public Void Do Public Int
Exampleinterface String: Public Interface Public Void Do Public Int
not specify an specific implementation (only its "interface"). More specific, this means
you can only specify methods, but not implement them.
Also java doesn't support multiple inheritance for classes. This is solved by using
multiple interfaces.
public interface ExampleInterface{
public void do();
public String doThis(int number);
}
public class sub implements ExampleInterface{
public void do(){
//specify what must happen
}
in this case
An interface can contain way more than method declarations: Constant fields, annotations, interfaces
and even classes