Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What exactly is a Marker Interface?

 
Sridhar Darbha
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not an advanced question. Moving...
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Answer in the FAQ:
http://faq.javaranch.com/view?JavaIntermediateFaq
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic