How do you just the @Deprecated annotation?

John Zukowski

You place the @Deprecated annotation above the method or class you want to flag as out of date. You can still use the @deprecated javadoc tag to say why something is deprecated:

public class Dep {
   * @deprecated Don't use this method any more.
  public static void myDeprecatedMethod() {
     System.out.println("Why did you do that?");
class DeprecatedUsage {
  public void useDeprecatedMethod() {