custom annotation in Java

Annotations are created by using \@interface. All annotations extends java.lang.annotation.Annotation interface. Annotations cannot include any extends clause.

```
import java.lang.annotation.*;
import java.lang.annotation.ElementType.*;

@Target(ElementType.TYPE_PARAMETER)
@interface My {}

class A {}
class B<@My A> { }


public class Main {
    public static void main(String args[]) {
    }
}
```