16.2 Annotation
16.2 | Custom Annotations Java provides the flexibility to define custom annotations as per need. An annotation is defined with the at-sign (@) preceding the interface keyword. The following steps show how to create and use custom annotations. Open Eclipse Select the package where annotation needs to be created. Right-click and select New → Annotation as shown in figure Creating a new annotation file Specify annotation name say RegressionTest. The following code shows the annotation code with no annotations and parameters. RegressionTest Above annotation can be directly used in code as: Use of Annotation Annotate the annotation as required.…