Notice: Constant WP_MEMORY_LIMIT already defined in /home/javawith/public_html/codesjava.com/wp-config.php on line 107

Notice: Constant WP_MAX_MEMORY_LIMIT already defined in /home/javawith/public_html/codesjava.com/wp-config.php on line 108
Java annotations tutorial for beginners - CodesJava

CodesJava

Easy learning with example program codes

java annotations beginners pdf


Notice: Undefined variable: footnotelist in /home/javawith/public_html/codesjava.com/wp-content/plugins/latex2html/inc/core.php on line 475

Dictionary meaning of Annotation

Annotation refers to a note by way of explanation or comment added to a text or diagram.

Java Annotations:

Java annotations are used to provide the meta data to our Java code. Meta data is the additional information which can be used for any class, interface, method or field. Java annotations can be used as an alternative option for XML and java marker interfaces. Java annotations were added to Java from Java 5.

Use of java annotations

Java annotations are mainly used for the following:

  • Compiler instructions
  • Build-time instructions
  • Runtime instructions

Compiler instructions:
Java provides the 3 in built annotations which are used to give certain instructions to the compiler. Java in built annotation are @Deprecated, @Override & @SuppressWarnings.

Build-time instructions:
Java annotations can be used for build time or compile time instructions. These instructions can be used by the build tools for generating source code, compiling the source, generating XML files, packaging the compiled code and files into a JAR file etc.

Runtime instructions:
Normally, Java annotations are not present in your Java code after compilation. However, we can define our own annotations that can be available at runtime. These annotations can be accessed using Java Reflection.

Java Annotation Tutorials


Please follow and like us:
error








Copyright © 2019 CodesJava DMCA.com Protection Status