Meaningless Drivel is fun!
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

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "How does a marker interface work?" Watch "How does a marker interface work?" New topic

How does a marker interface work?

Sanchita SenSharma

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

Joined: Mar 22, 2005
Posts: 42965
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.
I agree. Here's the link:
subject: How does a marker interface work?
jQuery in Action, 3rd edition