What is a deprecated API?

As classes evolve, their API change. To signal to developers that they are using an antiquated feature, class designers can flag classes or methods as deprecated. When used, the compiler will warn you of the invalid usage.

While deprecated classes and methods are still available for usage, at some future time it is possible that they will be dropped from the libraries.

If you get a message that says you are using a deprecated API at compile time, you can compile with the -deprecation option to javac to see any messages related to the deprecated API usage.