View RSS Feed

Java Object


Rate this Entry
by , 04-26-2012 at 06:26 PM (815 Views)
Annotations provide that data regarding program which is not program’s part. No direct effect they have at the code operation, they annotate.

Uses of the annotations are as following:

  • Information for compiler: Annotations can be used by the compiler for detection of the errors or suppress warning.
  • Deployment and compiler-time processing: Software tools can process the annotation information so that to generate the code, XML files or so forth.
  • Runtime processing: At runtime few annotations present are being examined.

To field’s declaration, methods, classes or program elements, the annotations might be applicable.
Annotations usually come first conventionally on its lines & may include elements that consist of un-named & named values:
Java Code:
   name = "Benjamin Franklin",
   date = "3/27/2003"
class MyClass() { }
@SuppressWarnings(value = "unchecked")
void myMethod() { }
One element known as value may go through the name omission:
void myMethod() { }
If elements are not present in annotation then parenthese omission might take place, as in:
void mySuperMethod() { }

Submit "Annotations" to Facebook Submit "Annotations" to Digg Submit "Annotations" to Submit "Annotations" to StumbleUpon Submit "Annotations" to Google

Tags: annotations Add / Edit Tags