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

Java Annotations  RSS feed

 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Am new to java annotations. There anyway I can add flag based annotations. In case if I want to change or remove some annotations I can do that by changing the flag and not by changing the code.
Please help
 
Rob Spoor
Sheriff
Posts: 21089
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, annotations and their values are always part of the source code. The values must be compile time constants as well - String literals, primitives, enums or Class objects.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!