*
The moose likes Java in General and the fly likes Null interfaces in Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Null interfaces in Java" Watch "Null interfaces in Java" New topic
Author

Null interfaces in Java

deepika bhatia
Greenhorn

Joined: Jun 26, 2009
Posts: 10
Hi,
does anyone know what are null interfaces in java and what is its significance
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10360
    
    8

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.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1477
    
    6

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.


Swastik
deepika bhatia
Greenhorn

Joined: Jun 26, 2009
Posts: 10
maneesh and swastik thanks for replying
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Null interfaces in Java