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

Deprecating?

 
Conrad Kirby
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have never heard of deprecating...would someone tell me what it means?
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Deprecation" is what Sun does when they come up with a better way of doing something in Java... they leave the old stuff in the API, so that old programs will work, but they warn you when you use it, so that you will know that there are better ( or at least newer ) ways to do what you are trying to do...

-Nate
 
Conrad Kirby
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then what is all of this about deprecating a method?
 
Dave Vick
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Conrad
When a method is deprecated it means that there is another recommended way of doing it. For example, this is the description of suspend form the API:
suspend
public final void suspend()
Deprecated. This method has been deprecated, as it is inherently deadlock-prone. If the target thread holds a lock on the monitor protecting a critical system resource when it is suspended, no thread can access this resource until the target thread is resumed. If the thread that would resume the target thread attempts to lock this monitor prior to calling resume, deadlock results. Such deadlocks typically manifest themselves as "frozen" processes. For more information, see Why are Thread.stop, Thread.suspend and Thread.resume Deprecated?.

Basically it is teling you that, yes, you can use it, but they recommend something else.
Also, it is a warning that, at some point, the deprecated method may no longer be supported.
hope that helps
Dave
[This message has been edited by Dave Vick (edited June 18, 2001).]
 
omerejaz
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Conrad Kirby:
I have never heard of deprecating...would someone tell me what it means?

depricated , means that it was firstly used with the older version of the jdk. and currently its use is over. that is
what i have heared.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic