Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How does a marker interface work?  RSS feed

 
Sanchita SenSharma
Greenhorn
Posts: 1
  • 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
  • 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
Posts: 42970
73
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!