What does the @ sign means in java? [duplicate]
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.
精彩评论