Delete deprecated elements in Java

We know that there are several deprecated elements in Java.

Will they be deleted? Have any obsolete items been removed from Java?

+8
java deprecated
source share
3 answers

Will they be removed?

It is unlikely, since Java has always supported backward compatibility, but this can happen. I see the deviations as a warning that the API is either unreliable or somehow seriously damaged. ( Thread has several of them).

Has any of the deprecated elements changed in the past from java?

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

+2
source share

This question is asked elsewhere .

Quite frankly, what the Java team usually does is to abandon the method and exclude its implementation instead of the proposed method. An obsolete method is simply an unrealized method.

+2
source share

According to the documentation here.

You can see what he says

The program element annotated with @Deprecated is something that programmers are not recommended to use, usually because it is dangerous, or because there is a better alternative.

Thus, an obsolete method or class is basically an older method or class that is not recommended, since there are newer logical ways to do this.

Will these methods be deleted?

Probably not. It will still work as before, but you must deal with an annoying warning. To ensure that previous programs still work correctly, which are not updated, almost all obsolete classes and methods will not be deleted solely for this reason.

Deprecated APIs are interfaces that are only supported for backward compatibility. The javac compiler generates a warning message when one of them is used, unless the -nowarn command-line option is used. It is recommended that programs be modified to exclude the use of obsolete APIs, although there is currently no plan to remove such APIs - with the exception of JVMDI and JVMPI - completely from the system.

Are any obsolete items fixed?

In the java class. * not. In the javax class. * There have been a few changes, but in regular java there has never been an obsolete method or class.

0
source share

All Articles