Defining an Interface


How to define an Interface?

✍: FYIcenter


Java Interface defines methods but does not implement them. Interface can include constants. A class that implements an interface is required to implement all the methods defined in the interface. Here is an example of interface definition:

public interface MyInterface {
   public string URL =
   public void method();
   public void anotherMethod();

2007-03-03, 5257👍, 0💬