Home  >  Article  >  Java  >  How to use Java’s @Documented annotation?

How to use Java’s @Documented annotation?

PHPz
PHPzforward
2023-04-22 20:01:061956browse

Description

1. @Documented is used to describe other types of annotations that should be used as public application programming interfaces for marked program members, so it can be used as tool documentation such as javadoc. Documented is a markup comment and has no members.

Function

2. Include comments in javadoc.

Example

@Documented
@interface B{
 
    String value() default "这是一个自定义类";
}
 
@B
public class MyTest2 {
 
    public static void main(String[] args) throws Exception{
        Class<?> c=Class.forName("hello3.B");
        System.out.println(c);
    }
}

What are the basic data types of java

The basic data types of Java are divided into:

1. Integer type , a data type used to represent integers.

2. Floating point type, a data type used to represent decimals.

3. Character type. The keyword of character type is "char".

4. Boolean type is the basic data type that represents logical values.

The above is the detailed content of How to use Java’s @Documented annotation?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete