This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How does a marker interface work?

 
Sanchita SenSharma
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 206
Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic