A good example of a common annotation would be the "@Override" annotation. You can add this annotation to methods that you've overridden. The compiler will throw an error if the method actually doesn't override anything. This is great because if you accidentally misspell the name of a method you want to override, it will point it out for you.
Annotations were added in Java 1.5.
SCJP 6 || SCWCD 5
Joined: Aug 03, 2008
yes i have generally seen in the IDE's that attach a marked warning, the warning can be replaced by putting an annotation. I would certainly go through the linked resources provided in this section and i hope it resolves my problem.
Joined: Oct 13, 2005
Be careful about replacing warnings by annotations; the @SuppressWarnings annotation might allow you to bypass the type checking in generics and suffer a ClassCastException later on. Adding the @Override annotation to all overridden methods is a good idea.