[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

deprecated

Posted on 2001-06-17
3
Medium Priority
?
433 Views
Last Modified: 2010-03-31
Hi,

i searched questions in EE for "deprecated" but did not find something.

Ok, my question is : how to solve a xxx.java with "deprecated" error message, when compiling ?

i am using JDK1.1.2, and a book says "deprecated" means obsolete code. Maybe i just download JDK1.1.0 ?

Thanks for any comments.
0
Comment
Question by:collinng
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 15

Accepted Solution

by:
ozymandias earned 200 total points
ID: 6200278
You will always get deprecated messages when compiling if you have used deprecated methods in your code.

They are warnings, not errors. It is generally safe to ignore them. Your code will still compile and run fine, but you need to bear in mind that at some point it will need updating.

If a method has been deprecated it is usually becuase it has been replaced by a new "better" method. Eventually that old method will be removed from the class at which point you will get real compile errors.

The best thing to do is check the Java API documentation for the class that has the deprecated method. This can be downloaded from http://java.sun.com. The description of the deprecated method will very often tell you what the new "recommended" method to the replace it is.
0
 
LVL 15

Expert Comment

by:ozymandias
ID: 6200281
A list of all deprecated classes, interfaces, exceptions, fields, methods and constructors comes with the Java API Documentation.

Here is an example :

The class java.awt.List has a deprecated method clear().
In the documentation the method is marked as deprecated and the following comment is shown :

  Deprecated. As of JDK version 1.1, replaced by removeAll().

This means that while you can use the clear method for the time being, it is recommended that you use the removeAll() method in future.
0
 
LVL 3

Expert Comment

by:shyamkumarreddy
ID: 6200976
Hi Collinng
When compiling. if u see depracated.

It is just a warning. that these methods are no more available in the current version of java. U need to change your method to the current available one.

Please recompile with -depreciation. It will list u all the methods need to be changed.

And refer to the documentation for the newer ones

Shyam
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question