File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Marker Interface??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Marker Interface???" Watch "Marker Interface???" New topic
Author

Marker Interface???

Rohit VG
Greenhorn

Joined: Oct 26, 2005
Posts: 2
What is the use of a marker interrface if it has no contents???
eg. Serializable interface.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

This gets asked a lot. Search the "Java in General (beginner)" forum, you'll find plenty of answers.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Ravinder S Edhan
Ranch Hand

Joined: Dec 15, 2003
Posts: 57
Hi,

It's not like that 'marker interface' does nothing? If you dig inside this 'Serializable' interface, you will come to know how does this work. There are 'writeObject' and 'readObject' kind of methods hidden behind the scene.

regards
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Originally posted by Ravinder S Edhan:

If you dig inside this 'Serializable' interface, you will come to know how does this work.


Ehm, no you won't. It is a marker interface, it has no source code that does anything. Below is a truncated version of the source code for Serializable (I've removed the comments to save space):
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Moving to Java in General (Beginner).


[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Marker Interface???
 
Similar Threads
marker interface
Java
What is advantage of marker interface?
Marker Interface
Marker Interface purpose