| Author |
Conceptual difference between annotation and marker interface.
|
Joseph Kulandai
Greenhorn
Joined: Sep 25, 2003
Posts: 3
|
|
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
Joined: Apr 14, 2004
Posts: 10336
|
|
"JK" Please check you private messages.
|
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24054
|
|
|
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.
|
[Jess in Action][AskingGoodQuestions]
|
 |
 |
|
|
subject: Conceptual difference between annotation and marker interface.
|
|
|