Link to home
Start Free TrialLog in
Avatar of Veneta
Veneta

asked on

deprecated warning

i have a deprecated warning. Which tells me that my applet uses a deprecated API and to recomplie with deprecation for details. Can someone tell me what i should do. I have a thread in my program that doesn't work. I am using jdk 1.1.8 and netscape 6. Any help would be much appreciated.

Thanks VENETA
ASKER CERTIFIED SOLUTION
Avatar of imladris
imladris
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mick Barry
If you use the -deprecation option when compiling it'll tell you what the problem is, and if you the check the javadoc for the deprecated method it will explain the preferred replacement method.
Hi Veneta


Deprecation means the a method in the current version of java is replaced with a good one. And it is no longer available from the current version. But still can be used to run the program. But in the next or future version may this method be removed. So better as said by object recompile with the -deprecation and it will tell where deprecated methods are there just go the javadoc and refer to the class which says deprecated and know more abt it
and change ur code :)

Regarding your thread if u can post your code we could help u to solve it


Cheers
shyam
Avatar of theoyaung
theoyaung

Here's what Sun has to say about deprecated if you want to hear the authority =)

from http://java.sun.com/products/jdk/1.1/docs/guide/misc/deprecation/deprecation.html#what

===What "Deprecated" means===

You may have heard the term, "self-deprecating humor". That is humor that minimizes your importance. A deprecated class or method is like that. It is no longer important. It is so unimportant, in fact, that it should no longer be used at all, as it will probably cease to exist in the future.

The need for deprecation comes about because, as a class evolves, its API changes. Methods are renamed for consistency. New and better methods are added. Attributes change. But making such changes introduces a problem. You need to keep the old API around until people make the transition to the new one, but you don't want developers to continue programming to the old API.

The ability to mark a class or method as "deprecated" solves the problem. Existing classes that use the old API continue to work, but the compiler can issue a warning when it finds references to deprecated items. Meanwhile, the API comments can warn the user against using the deprecated item and tell the user how to avoid doing so. The @deprecated tag achieves these goals.

Note: "Deprecated" and "depreciated" are not same. "Depreciated" is a financial term that means "lowered value". Although the meanings are similar, classes and methods are deprecated, not depreciated.
hi

The deprecation warning has nothing to do with your thread not working. It is merely alerting you to
the fact that you are using methods that will work now, but may not exist in a future release of Java.

kaspak
Not necessarily, the methods in Thread are deprecated not only because they may not exist in the future, but also because they are 'unsafe'.
Though you're probably right that their thread problem is something separate.
Hi Objects
U r correct. But this thread is one of the class which has unsafe methods. which needs to be replaced for safety.

I don't think anyother class has the same think like thread class


Shyam

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:


[split points between objects,shyamkumarreddy and imladris]


Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
sudhakar_koundinya
EE Cleanup Volunteer
---------------------
If you feel that your question was not properly addressed, or that none of the comments received were appropriate answers, please post your concern in THIS thread.