aspose file tools*
The moose likes Beginning Java and the fly likes what is mean by Marker interface? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "what is mean by Marker interface?" Watch "what is mean by Marker interface?" New topic
Author

what is mean by Marker interface?

ganesh pol
Ranch Hand

Joined: Apr 29, 2005
Posts: 151
friends

what is mean by Marker interface?
Krishnan Loganathan
Greenhorn

Joined: Apr 24, 2004
Posts: 23
Hi,
An interface which contains no methods or member variables will be called as Marker Interface. For eg:- Remote, Serializable or marker interfaces. Why because, the compiler will check whether that class is an instance of that interface ( for eg:- serializable) and if it is true means, it will serialize that object.

Regards,
Loga
ganesh pol
Ranch Hand

Joined: Apr 29, 2005
Posts: 151
i have not got it yet
Manuel Moons
Ranch Hand

Joined: Mar 05, 2002
Posts: 229
A Marker interface is used to indicate that a class can be used for a specific purpose. Look at the Serializable interface, it actually has no methods that you have to implement. But it indicates that a class that implements this interface can be (de)serialized (converted to a byte representation).

If you, for instance, want to save an object to disk using an ObjectOutputStream, only objects that implement the Serializable interface can be saved.
Andrew Nomos
Greenhorn

Joined: May 31, 2005
Posts: 18
A marker interface is indeed a interface that contains no methods.

Why is this useful --> polymorphism
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: what is mean by Marker interface?