@符号在java中意味着什么?

时间:2021-07-16 16:54:53

Below is the code snippet.

以下是代码段。

@Intercepts({@Signature(
type= Executor.class,
method = "update",
args = {MappedStatement.class,Object.class})})
public class

Can someone explain to me what @ sign means in Java?

有人可以向我解释一下@ sign在Java中的含义吗?

4 个解决方案

#1


26  

It's an Annotation.

这是一个注释。

Annotations are a form of metadata. They provide data about a program that is not part of the program itself. Annotations have no direct effect on the operation of the code they annotate.

注释是元数据的一种形式。它们提供有关不属于程序本身的程序的数据。注释对它们注释的代码的操作没有直接影响。

Annotations do affect the way programs are treated by tools and libraries, which can in turn affect the semantics of the running program. Annotations can be read from source files, class files, or reflectively at run time.

注释会影响工具和库处理程序的方式,这反过来又会影响正在运行的程序的语义。可以从源文件,类文件或运行时反射性地读取注释。

#2


4  

It's an annotation.

这是一个注释。

Here's more information on it: http://www.alden-java-hosting.com/JAVA-tutorial/java/javaOO/annotations.html

以下是有关它的更多信息:http://www.alden-java-hosting.com/JAVA-tutorial/java/javaOO/annotations.html

Here are Oracle's docs since it looks like the other link is down: http://docs.oracle.com/javase/tutorial/java/annotations/

以下是Oracle的文档,因为看起来其他链接已关闭:http://docs.oracle.com/javase/tutorial/java/annotations/

#3


2  

Yeap. All the previous posters are correct, it's annotations and the links are correct.

叶氏。所有以前的海报都是正确的,它是注释,链接是正确的。

For our C# buddies out there, I think it's akin to attributes.

对于我们的C#好友,我认为它类似于属性。

#4


0  

Its is a Annotation and it serves very great purpose as metadata to inform JVM about methods or other things.

它是一个Annotation,它作为元数据非常有用,可以通知JVM有关方法或其他内容的信息。

#1


26  

It's an Annotation.

这是一个注释。

Annotations are a form of metadata. They provide data about a program that is not part of the program itself. Annotations have no direct effect on the operation of the code they annotate.

注释是元数据的一种形式。它们提供有关不属于程序本身的程序的数据。注释对它们注释的代码的操作没有直接影响。

Annotations do affect the way programs are treated by tools and libraries, which can in turn affect the semantics of the running program. Annotations can be read from source files, class files, or reflectively at run time.

注释会影响工具和库处理程序的方式,这反过来又会影响正在运行的程序的语义。可以从源文件,类文件或运行时反射性地读取注释。

#2


4  

It's an annotation.

这是一个注释。

Here's more information on it: http://www.alden-java-hosting.com/JAVA-tutorial/java/javaOO/annotations.html

以下是有关它的更多信息:http://www.alden-java-hosting.com/JAVA-tutorial/java/javaOO/annotations.html

Here are Oracle's docs since it looks like the other link is down: http://docs.oracle.com/javase/tutorial/java/annotations/

以下是Oracle的文档,因为看起来其他链接已关闭:http://docs.oracle.com/javase/tutorial/java/annotations/

#3


2  

Yeap. All the previous posters are correct, it's annotations and the links are correct.

叶氏。所有以前的海报都是正确的,它是注释,链接是正确的。

For our C# buddies out there, I think it's akin to attributes.

对于我们的C#好友,我认为它类似于属性。

#4


0  

Its is a Annotation and it serves very great purpose as metadata to inform JVM about methods or other things.

它是一个Annotation,它作为元数据非常有用,可以通知JVM有关方法或其他内容的信息。