Meaningless Drivel is fun!*
The moose likes Beginning Java and the fly likes What exactly is a Marker Interface? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "What exactly is a Marker Interface?" Watch "What exactly is a Marker Interface?" New topic
Author

What exactly is a Marker Interface?

Sridhar Darbha
Greenhorn

Joined: Dec 12, 2006
Posts: 14
Most of the popular books on Java define Marker Interface as an Interface which has no menthods in it.

I know atleast two Marker Interfaces( eg. Runnable , java.lang. Comparable) which have a method in them.

What then is the exact definition of a Marker Interface?

Is the definition of Marker Interface in many of the popular books on Java misleading?

Please answer!!!
Thanks in advance.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Not an advanced question. Moving...


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707

I know atleast two Marker Interfaces( eg. Runnable , java.lang. Comparable) which have a method in them.


Wrong, Runnable and Comparable are not marker interfaces.

As I know marker interface is an interface with no methods in it. As Serializable, we don't implement any method when we implement the Serializable interface.

With Regards,
cmbhatt


cmbhatt
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Answer in the FAQ:
http://faq.javaranch.com/view?JavaIntermediateFaq


[My Blog]
All roads lead to JavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What exactly is a Marker Interface?