【八喜小子】JDK中新加功能标签:@Override - 重写,什么时候使用?

来源:百度知道 编辑:UC知道 时间:2024/05/25 01:05:32
我在学习java中遇到这个功能标签:@Override - 重写,请问大虾们,这个标记符在什么时候使用?使用后有什么作用呢?为什么要使用?

谢谢!

这个叫做java annotation(java 注解)

To benefit from annotations, you need to select a processing tool. You insert annotations into your code that your processing tool understands, and then apply the processing tool.

按照书中的说法, 他就是为一些工具提供的标示
比如@Test 就是为junit提供的,Junit在运行的时候会自动去寻找这些annotation