Using the Deprecated annotation
The @Deprecated annotation can be used to indicate elements which should no longer be used. Any program that uses an element which is marked as @Deprecated will produce a compiler warning. @Deprecated public void oldMethod() { ... } public void newMethod() { ... } In this examples, newMethod replaces oldMethod. However we do not want to remove oldMethod completely because keeping it will help maintain backwards compatibility with older versions of the program....