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

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: Java Language
Expertise: Beginner
Dec 23, 1997

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


Deprecated API

Question:
When I compile my applets or applications, the compiler often tells me I'd use a "deprecated API" and that I should recompile with the option "-deprecate". If I do so, the warning does not appear any more, but I haven't noticed a difference in the behavior of the applications and applets, respectively. What does it mean when the compiler warns me that I have a "deprecated API"?

Answer:
A deprecated API is a set of methods or classes that have either been superseded by new ones or that have simply been discontinued. Deprecated API's may or may not be supported in future versions of Java, but will most likely be phased out. The compiler warns you about the deprecation so that you may gradually update your code to use new API's. Otherwise your code may not work with a future version of Java that completely eliminates the deprecated API's.

The idea behind deprecating an API is to give programmers a chance to update their code rather than catch them off guard and force them to do so immediately. Although we have yet to see how Sun is going to handle deprecation, the implication is that when an API is to be discontinued it will first become deprecated. Then in the next major release after deprecation it will be completely eliminated.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


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

 

 

Sitemap
×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date