• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Null interfaces in Java

 
deepika bhatia
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
does anyone know what are null interfaces in java and what is its significance
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Null interface is another name for marker interface. (I personally prefer marker)

Such an interface is empty, i.e. without any method declarations. Serializable interface is a classic example.
When any object implements Serializable, the JVM knows that it is supposed to treat it in a special way.

Google() for more information. This is a much discussed topic.
 
Swastik Dey
Rancher
Posts: 1603
5
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
null interface is an interface that does not contain any method but is used to perform a special task. For e.g. Serializable interface, which does not have any method. But if we wish to serialize any class it must implement Serializable interface.
 
deepika bhatia
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
maneesh and swastik thanks for replying
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic