This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Java in General and the fly likes How to deprecate? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to deprecate?" Watch "How to deprecate?" New topic

How to deprecate?

Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
How does one deprecate a class, method, field, or constructor? How does the compiler know what is deprecated?
Apu Nahasapeemapetilon
Ranch Hand

Joined: Sep 06, 2000
Posts: 51
You don't deprecate, the Java compiler for whatever version deprecates.
How does the compiler know what to deprecate? How does the compiler know what is not deprecated? How does the complier know what is valid java code and how does it know what is not?
The simple answer is that what compilers do!
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Sorry I asked. Flippant remarks are only funny when you're right, and (IMO) not appropriate here even then. People come here to share knowledge, not to flame. I just went and found it myself, and it turns out there's a simple way to do it in any Java code, not just Sun's. Your answer has been @deprecated.
Michal Harezlak
Ranch Hand

Joined: Jul 06, 2000
Posts: 185
Thanks, it was a very good question and an excellent respond! How and When To Deprecate APIs
Jayakumar Thirumalai

Joined: Jul 08, 2000
Posts: 15
Hello Michal,
You have given a link to a very good article on "How and when to Deprecate API?".

Jayakumar Thirumalai
I agree. Here's the link:
subject: How to deprecate?
jQuery in Action, 3rd edition