>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

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
Lew - 26 Jul 2007 14:15 GMT
"George3" wrote, quoted or indirectly quoted someone who said :
>> Are there any samples of how to use @override?
Once again, it's "@Override", George3. Spelling matters.
> like any annotation, you put it between the JavaDoc and the method
> definition. see http://mindprod.com/jgloss/annotations.html
This is also explained in the link I provided upthread. Did you read it?
Take note of these answers as people provide them. They often will be helpful.

Signature
Lew
Oliver Wong - 30 Jul 2007 18:42 GMT
>>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
> Thanks Lew,
>
[quoted text clipped - 5 lines]
>
> Are there any samples of how to use @override?
http://java.sun.com/docs/books/tutorial/java/javaOO/annotations.html
Once again: It's @Override, not @override. Also, you won't
be able to use it at all until you move to a newer JDK.

Signature
Eric Sosman
esosman@ieee-dot-org.invalid