Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

empty interface

 
pulijala hari
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Why shall we use an empty interface(marker interface)?
Is there any specific use if there are no methods in the interface?

regards,
hari
 
A Sethi
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A marker interface is a interface with emplty methods/behavior. One of its purposes is to tag the classes implementing this interface. mainly this is used to group classes of the interface type.

In this case, any instances of the class are valid instances of interface.

refer to this link.
http://forum.java.sun.com/thread.jspa?threadID=608939&messageID=3330376
 
Raghuveer Kumarakrishnan
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found this link useful

http://www.devx.com/tips/Tip/5266


Hope this helps!!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic