Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

annotation

 
Sergio Gazzini
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In docs:
"The common interface extended by all annotation types. Note that an interface that manually extends this one does not define an annotation type. Also note that this interface does not itself define an annotation type."
But what means "manually extends"?
Which another way to extend interface?
Thanks.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15436
41
Android IntelliJ IDE Java Scala Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It means that if you write code like this:

in other words, you create an interface that explicitly extends Annotation, then MyAnnotationButNotReally is not an annotation.

You create annotations using @interface instead:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic