Abstract class(Abstract class) and interface are opposite side of same coin. You can declare interface by interface interface_name.
Following are the some important points about interface:
Following are the some important points about interface:
- Interface contain only method signarute.
- As like abstract class,interface can not be instantiated.
- In interface by default member variables are public static final.
- Interface does not have constructor.
- One interface can extend multiple interfaces at once. As this is not applicable for classes.
- To implement a interface we use "implements" keyword.
- Java contain some empty interfaces like Serialzable, Cloanable...etx. They don't have any method signature.