Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / July 2007

Tip: Looking for answers? Try searching our database.

@override?

Thread view: 
George3 - 25 Jul 2007 15:50 GMT
Hello everyone,

I am using JDK 1.4 and there is a compiling a 3rd party program error because
of un-recognized word @override. Could anyone let me know what is the
function of @override and in order to use it, which version of JDK is
required?

thanks in advance,
George
Lew - 25 Jul 2007 16:55 GMT
> I am using JDK 1.4 and there is a compiling a 3rd party program error because
> of un-recognized word @override. Could anyone let me know what is the
> function of @override and in order to use it, which version of JDK is
> required?

It's an annotation:
<http://java.sun.com/docs/books/tutorial/java/javaOO/annotations.html>

Annotations were introduced in Java 5.

You should seriously consider using a current version of Java.

Signature

Lew

Lew - 25 Jul 2007 16:58 GMT
>> I am using JDK 1.4 and there is a compiling a 3rd party program error
>> because
[quoted text clipped - 8 lines]
>
> You should seriously consider using a current version of Java.

BTW, it's "@Override".

Signature

Lew

George3 - 26 Jul 2007 09:16 GMT
Thanks Lew,

>>> I am using JDK 1.4 and there is a compiling a 3rd party program error
>>> because
[quoted text clipped - 3 lines]
>
>BTW, it's "@Override".

Are there any samples of how to use @override?

regards,
George
Roedy Green - 26 Jul 2007 13:57 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
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
Eric Sosman - 26 Jul 2007 14:13 GMT
> 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

Roedy Green - 25 Jul 2007 19:30 GMT
>I am using JDK 1.4 and there is a compiling a 3rd party program error because
>of un-recognized word @override. Could anyone let me know what is the
>function of @override and in order to use it, which version of JDK is
>required?
see http://mindprod.com/jgloss/annotations.html
It just means this method overrides some other method.
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

George3 - 26 Jul 2007 09:20 GMT
Thanks Roedy,

>>I am using JDK 1.4 and there is a compiling a 3rd party program error because
>>of un-recognized word @override. Could anyone let me know what is the
>>function of @override and in order to use it, which version of JDK is
>>required?
>see http://mindprod.com/jgloss/annotations.html
>It just means this method overrides some other method.

Are there any samples of how to use @override? I can not find in this
document.

regards,
George
Roedy Green - 26 Jul 2007 13:57 GMT
>Are there any samples of how to use @override? I can not find in this
>document.
The upload is taking a while . I thought it would be ready before you
read my post. Check again in about 20 minutes.
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.