Home  >  Article  >  Java  >  What is the essence of java annotations

What is the essence of java annotations

王林
王林forward
2023-05-14 16:34:061258browse

1. Description

(1) The essence of annotation is the interface that inherits the Annotation interface. At this point, any annotation category can be back-translated to get the result.

(2) A comment is just a special comment. If you don't analyze its code, it may not even be as good as comments.

2. Example

This is the definition of the annotation @Override. In fact, it is essentially:

public interface Override extends Annotation{
    
}

The typical annotation @Override, when When the compiler detects a method, and when the compiler detects the @Override annotation, the compiler checks whether the name actually overrides a certain method of the parent, that is, it compares whether the parent has the same method signature.

What are the characteristics of Java

1. As a representative of static object-oriented programming language, Java language implements object-oriented theory and allows programmers to perform complex programming with an elegant way of thinking.

2.Java has the characteristics of simplicity, object-oriented, distributed, security, platform independence and portability, and dynamic nature.

3. Use Java to write desktop applications, Web applications, distributed systems and embedded system applications, etc.

The above is the detailed content of What is the essence of java annotations. 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