my dog learned polymorphism*
The moose likes Beginning Java and the fly likes empty interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "empty interface" Watch "empty interface" New topic
Author

empty interface

pulijala hari
Ranch Hand

Joined: May 14, 2005
Posts: 70
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

Joined: Oct 11, 2005
Posts: 6
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

Joined: Mar 13, 2005
Posts: 32
I found this link useful

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


Hope this helps!!!


Raghu<br />SCJP 1.4<br />SCWCD 1.4<br />SCBCD 1.3
 
jQuery in Action, 2nd edition
 
subject: empty interface
 
Similar Threads
Interface Q
Separators
Marker Interface purpose
Empty abstract classs vs Empty interface
use of empty interface