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

Java Annotations

 
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
Pie
Posts: 20606
60
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic