File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Java 2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java 2" Watch "Java 2" New topic

Java 2

veena sriram

Joined: Feb 28, 2001
Posts: 2
Hi everyone,
I am a novice in Java.I am using the TextPad for java.
When I compile a file, the compiler says that java uses or overrides a deprecated API.Could anyone say why is this so??
Chris Stehno
Ranch Hand

Joined: Feb 26, 2001
Posts: 180
What that means is that one of the members you used in your code is 'deprecated'. The JavaDocs for the class will tell you if a member is deprecated (bolded).
Deprecated means that the member in question is no longer to be used. An alternative is usually provided. There are numerous deprecated methods all over the Java packages ... they come up with a better or different way of doing something that requires changes to existing code.
I hope this helps.
Also you can run your java compiler with -deprecation to show the exact name of the deprecated member.
Chris Stehno (Sun Certified Programmer for the Java 2 Platform)

- Chris Stehno, SCPJ
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4351

Deprecated methods still work they are just not the recommended way of doing things. They may not be supported at a later time.

Visit my download page
niraj singh
Ranch Hand

Joined: Feb 07, 2001
Posts: 36
Hi Veena,
Java Development Kit (JDK) has evolved over time and each version has it's own version number starting from 1.0 to 1.1 to 1.2 and till the latest 1.3. Java 1.2 onwards is called Java 2. Certain methods in the Java classes may not run in the way they should be or a better implementation of the method may be developed. These new modifications are incorporated in the later versions of JDK. The old methods which still work, but have been deprecated to tell the developer during compilation, that a better method exists for a certain method in the code. The code will still run without any problem. The deprecated error message during compilation, is just a warning for the developer.
veena sriram

Joined: Feb 28, 2001
Posts: 2
thanks everyone for the replies.Will talk back at a later time.
I agree. Here's the link:
subject: Java 2
It's not a secret anymore!