Re: @override?




"Roedy Green" <see_website@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:5h6ha3t6vhu9u7rhnp9pae2ior0idoj0di@xxxxxxxxxx
On Thu, 26 Jul 2007 08:16:48 GMT, "George3" <u19006@uwe> wrote, quoted
or indirectly quoted someone who said :

Are there any samples of how to use @override?
like any annotation, you put it between the JavaDoc and the method
definition. see http://mindprod.com/jgloss/annotations.html

Annotations can appear in other locations than on a method (but for
@Override, it only makes sense in that location).

You can put annotations on fields, or on specific parameters of a
method, for example.

public class Example {
@DoNotSerialize
public int fieldThatShouldntBeSerialized;

public int myMethod(@NonNull String foo) {
/*doesn't check against null here, because the contract of the method
assumes that it won't receive null as a parameter.*/
return foo.hashcode();
}
}

- Oliver


.