Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java 2

 
veena sriram
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)
 
Randall Twede
Ranch Hand
Posts: 4481
3
Java Python Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Deprecated methods still work they are just not the recommended way of doing things. They may not be supported at a later time.
 
niraj singh
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks everyone for the replies.Will talk back at a later time.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic