Friday 27 June 2014

@Retention

@Retention annotation specifies how the marked annotation is stored.
  1. RetentionPolicy.SOURCE – The marked annotation is retained only in the source level and is ignored by the compiler.
  2. RetentionPolicy.CLASS – The marked annotation is retained by the compiler at compile time, but is ignored by the Java Virtual Machine (JVM).
  3. RetentionPolicy.RUNTIME – The marked annotation is retained by the JVM so it can be used by the runtime environment.

Prevoius                                                 Next                                                 Home

No comments:

Post a Comment