Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Java
Expertise: Advanced
May 28, 2003

Deprecate Old APIs

When you write a new version of an API, you want to deprecate the old API. If you deprecate old API's, the compiler will tell you wherever that deprecated API is being used. SUN uses this practice to slowly eliminate older APIs.

To deprecate a method, write the following javadoc comment above the method.


/**
 * @deprecated This method is being deprecated from next version
 *
/
public void m1()
{
   XXXX
}
To enable deprecation messages, compile sources with the deprecation option:

javac -deprecation
Ruchi Dhar
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap