Java - Annotating Java Package


Create a file named, and place the annotated package declaration in it.

The following code shows the contents of the file.

When you compile the file, a class file will be created.

@Version(major=1, minor=0)
package com.book2s.annotation;

You can have contents like the following in a file:

package com.book2s.annotation;

import com.book2s.myannotations.Reviewer;

The import statement is used to import annotation type.