Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will deprecated items in Java be removed

We know that there are several deprecated items in Java.

Will they be removed? Have any deprecated items ever been removed from Java?

like image 895
Easwaramoorthy K Avatar asked Nov 17 '11 07:11

Easwaramoorthy K


People also ask

Should deprecated code be removed?

A deprecated class or method is like that. It is no longer important. It is so unimportant, in fact, that you should no longer use it, since it has been superseded and may cease to exist in the future.

What happens to deprecated methods in Java?

Similarly, when a class or method is deprecated, it means that the class or method is no longer considered important. It is so unimportant, in fact, that it should no longer be used at all, as it might well cease to exist in the future. The need for deprecation comes about because as a class evolves, its API changes.

What does it mean when something is deprecated Java?

A program element annotated @Deprecated is one that programmers are discouraged from using, typically because it is dangerous, or because a better alternative exists. Compilers warn when a deprecated program element is used or overridden in non-deprecated code.

Can deprecated code still be used?

It means that it is bad practice to use it. It can still be used, but eventually it will not work with other things because it is no longer being supported. Best practice is to use the requested alternative to any depreciated type.


1 Answers

Will they be removed?

Unlikely since java has always been about maintaining backward compability, but it can happen. I see deprecations as a warning that the API is either unreliable or somehow seriously flawed. (Thread has several of these).

Has any of the deprecated items in the past has been removed from java?

AFAIC not removed but never implemented Thread.destroy(), as it was along with several other Thread methods inherently unsafe.

like image 149
josefx Avatar answered Sep 21 '22 15:09

josefx