Wednesday, May 23, 2018

What is Annotation?


What is Annotation?


Since most of the spring boot configurations are done by annotations,it is better if we go through what annotations are first.

Annotation : provides information about the program that is annotated with and it is not part of the program itself.

These annotations can be run time or compile time annotations

Compile Time Annotations
Compile time annotations are checked by the compiler at compile time.

public interface test { 

 public void add(int a,int b);
}

class tester implements test{
 @Override
 public void add(int a, int b) {  
 }
 
}
In the above code Annotation @Override is compile time,if you try to add or remove any parameter it will show an error in IDE itself.

Run Time Annotations
As the Compile time annotation,run time annotation checks for run time information about the program that is annotated with.
Share:

0 comments:

Post a Comment