Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is deprecated?

 
sheng zhong
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are transverse lines on some methods, and says the method is deprecated. What's this? Can I delete it?
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Deprecated" usually means the method has been replaced with a newer, preferred way of accomplishing the same thing. The old (deprecated) method is kept in the API only for back-compatability, and should not be used in new code.
[ November 23, 2006: Message edited by: marc weber ]
 
Scott Johnson
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A deprecated method is a method that the author says should not be used.

It's probably been replaced with a new/better method.

The deprecated method may be removed completely in a future version of the class.

You can continue to use the method at your own risk.

The javadoc may have more information including which method replaces the deprecated one.
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As and when better way to do things are found , the old method is rendered as deprecated.For most of the cases , the javadoc mentions that why that has been deprecated and what is suppose to be used in similar situations.

Even I have seen that in many of the projects , they do a clean up process from time to time for the removal of the deprecated code.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic