Tuesday, 17 November 2015

What is an Interface ? What is marker interface

Interface is nothing but 100% abstract methods up to java 7 but Java 8 onwards we can use void methods
1. Allowed Modifiers for Interface : public, abstract, default
2. Allowed Modifiers for Interface variables : public , static and final.


Marker Interface: Interfaces with no field or methods, in simple word we can say empty interface, is called Marker or Tag Interface. Marker interface is used as a tag to pass a message to java compiler so that it can add special behavior to the class that implementing it. Clonable and Serializable are example of Marker Interface.

 

Payment.java

No comments:

Post a Comment