Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Marker interface

 
eswar kumar
Ranch Hand
Posts: 98
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what are the marker interfaces available in Java( except Single Thread Model,serializable)?what is the use marker interface?
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's just a sign that you'd like an object to be treated some special way later. For example "Serializable" says if the JVM is serializing a bunch of objects this one would like to be included. Any objects that do not implement Serializable will be left out. Almost too simple to be true, no?
 
norman richards
Author
Ranch Hand
Posts: 367
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you'll see marker interfaces fall out of favor when Java 1.5 comes out. Annotations (JSR 175 "metadata") captures this information in a much cleaner way. There isn't really much intro material on annotations yet, but keep your eyes open for it...
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic