• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

Method Deprecation  RSS feed

 
Greenhorn
Posts: 9
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi to all, Well can you guys please tell me that how to deprecate a method.
Thanks in advance.
 
Java Cowboy
Sheriff
Posts: 16084
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Java 5 or newer, add the @Deprecated annotation.
In Java 1.4 or older, use the @deprecated JavaDoc tag in the JavaDoc comments above the method.
 
Sheriff
Posts: 21503
96
Chrome Eclipse IDE Java Spring Ubuntu VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Jesper Young:
In Java 5 or newer, add the @Deprecated annotation.
In Java 1.4 or older, use the @deprecated JavaDoc tag in the JavaDoc comments above the method.


Actually, in Java 5 and up you should use both. That way, the API created by Javadoc also explains WHY the method etc is deprecated (given that the developer added this information).
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!