File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Marker Interface purpose Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "Marker Interface purpose" Watch "Marker Interface purpose" New topic
Author

Marker Interface purpose

rex tony
Ranch Hand

Joined: Aug 29, 2007
Posts: 159
Marker Interface is the empty interface.What is their purpose?
Kelvin Chenhao Lim
Ranch Hand

Joined: Oct 20, 2007
Posts: 513
Basically, marker interfaces are used to indicate that a class supports a special Java language functionality, but (unlike normal interfaces) this functionality isn't expressed solely through its method definitions.

Prior to Java 1.5, there was no way to describe a class's properties beyond the standard modifiers (public, private, etc), so marker interfaces were used for this purpose. Admittedly, it does feel a bit like a hack, because it's seems strange that Java assigns special meanings to a few interfaces (java.io.Serializable, java.lang.Cloneable, java.rmi.Remote, etc). Java 1.5 introduced annotations, which (in my opinion) would have been a far better mechanism for these purposes, if annotations had existed when Java was first released.


SCJP 5.0
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35252
    
    7
This question was asked just yesterday; see here for the answer.


Android appsImageJ pluginsJava web charts
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Marker Interface purpose
 
Similar Threads
Marker/Tag interfaces.
Marker Interface
Purpose RandomAccess Interface
Can we create our own Marker Interfaces...?
Marker interfaces