Answer the question
In order to leave comments, you need to log in
Why are arguments passed to the annotation in this way?
I'm sorry for the stupid question, but I'm really new to programming. While studying Java annotations, I came across the following code:
@Version(version = 42)
public class MyClass {}
public @interface Version {
int version();
}
Answer the question
In order to leave comments, you need to log in
This thing is called annotations, used very heavily in J2EE! For a good understanding, I advise you to create a small project using annotations as markers or as mathematical data for any calculations. For example, write your bean validator.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question