开发者

What does the @ sign means in java? [duplicate]

开发者 https://www.devze.com 2023-01-02 11:10 出处:网络
This question already has answers here: in java what does the @ symbol mean? 开发者_JS百科(6 answers)
This question already has answers here: in java what does the @ symbol mean? 开发者_JS百科 (6 answers) Closed 1 year ago.

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?


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.


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.


It's an annotation.

Here's more information on it: 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/


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

0

精彩评论

暂无评论...
验证码 换一张
取 消