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

Conceptual difference between annotation and marker interface.

 
Joseph Kulandai
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Marker interface informs a compiler about a class. Sameway annotation is also gives information about class / method / object.

Then in what way they are different?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"JK"

Please check you private messages.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Marker interfaces have been a part of Java since the beginning, while annotations were only introduced with Java 5. Everything that can be done with marker interfaces can be done instead with annotations; and in fact, it's now recommended that the "marker interface pattern" not be used any longer. Annotations can have parameters of various kinds, so they're much more flexible.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic