my dog learned polymorphism*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes How does a marker interface work? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "How does a marker interface work?" Watch "How does a marker interface work?" New topic
Author

How does a marker interface work?

Sanchita SenSharma
Greenhorn

Joined: Sep 01, 2008
Posts: 1
Since a marker interface doesnt have any method declaration, how does the JVM understand what functionality should it support. For eg: Serializable is a marker interface. Now how does the JVM understands that it has to serialize the method of the class that implements it?
chander shivdasani
Ranch Hand

Joined: Oct 09, 2007
Posts: 206

Marker interface is a design pattern which is used to indicate that a particular class supports some kind of functionality

In case of Serializable, a class implements this interface to indicate that its non-transient data members can be written to an ObjectOutputStream


Enjoy, Chander
SCJP 5, Oracle Certified PL/SQL Developer
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41873
    
  63
Welcome to JavaRanch.

Please use the "Search" link at the top of the page to find the many, many threads where this question has been asked.


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How does a marker interface work?