• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Deprecated API Usage

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why does the compiler shows only warnings at usage of deprecated APIs.
It should have thrown an error when any deprecated stuff is used right?
why is the implementation like that?

Thanks,
Neelima

 
author
Posts: 23931
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Neelima Mohan wrote:Why does the compiler shows only warnings at usage of deprecated APIs.
It should have thrown an error when any deprecated stuff is used right?
why is the implementation like that?




The purpose of deprecation is to allow old programs -- sometimes really really large old programs -- to still run when the API changes.

If the compiler fails to compile these old programs, then what would be the point of deprecation? You might as will remove the deprecated APIs entirely, as it would be an unusable API anyway.

Henry
 
Neelima Mohan
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ohhh ok thanks :-)
 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
deprecation doesn't mean the API has been removed. Its still there in your jdk but it has been marked to tell that it would might be removed in the next upgrade of jdk future and that one should not use it for any new development which would use the future upgraded jdk. It also tells the programmer the places to change the code in order to make existing code compatible with the next upgrade of jdk.
 
reply
    Bookmark Topic Watch Topic
  • New Topic