Possible Duplicate:
What function do these Java annotations serve?
How and where are Annotations used in Java?
Well I'm trying to figure out, what annotations are, read plenty of docs, but still don't understand what they do and how to use it... Well I have this sample annotation description:
@Documented
@interface ClassPreamble {
String author();
int currentRevision() default 1;
String lastModified() default "N/A";
String lastModifiedBy() default "N/A";
}
And then I'm trying to use it, but I don't even know what to expect, lol:
@ClassPreamble (author = "James")
public class PreAmbleReal {
static public void main(String[] args) {
}
public String author();
}
So, can anyone explain this to me? Otherwise I'll have wasted a few hours of time and learn nothing. :/