aspose file tools*
The moose likes Beginning Java and the fly likes How do you deprecate a class, and/or a method? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How do you deprecate a class, and/or a method?" Watch "How do you deprecate a class, and/or a method?" New topic
Author

How do you deprecate a class, and/or a method?

Jonathan Baker
Greenhorn

Joined: Jun 18, 2001
Posts: 2
I need to deprecate a method, and I wasn't exactly sure how to do that. I thought it would just be some keyword like static, private, etc. but it looks as though that is not the case.
Julia Reynolds
Ranch Hand

Joined: May 31, 2001
Posts: 123
You have to use javadoc commenting. You add the @deprecated tag
to denote it. The compiler parses it out.
Julia
Jonathan Baker
Greenhorn

Joined: Jun 18, 2001
Posts: 2
Thank you.
rani bedi
Ranch Hand

Joined: Feb 06, 2001
Posts: 358
How does the compiler knows that the depreciated method is being used (since whenever we try to compile a code using some depreciated method we recieve a warning message)
How can I do it in my code?


Cheers,<br />Rani<br />SCJP, SCWCD, SCBCD
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
The compiler reads the JavaDoc parameters.
Read this article: http://java.sun.com/j2se/1.3.0/docs/guide/misc/deprecation/deprecation.html


"JavaRanch, where the deer and the Certified play" - David O'Meara
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How do you deprecate a class, and/or a method?