注解1 --- JDK内置的三个基本注解 --- 技术搬运工(尚硅谷)

@Override: 限定重写父类方法, 该注解只能用于方法
@Deprecated: 用于表示所修饰的元素(类, 方法等)已过时。通常是因为所修饰的结构危险或存在更好的选择
@SuppressWarnings: 抑制编译器警告
package com.annotation.javadoc;
public class AnnotationTest{
  public static void main(String[] args) {
    @SuppressWarnings("unused")
    int a = 10;
  }
  @Deprecated   
public void print(){     System.out.println("过时的方法");   }
  @Override   
public String toString() {     return "重写的toString方法()";
  }
}
原文地址:https://www.cnblogs.com/noyouth/p/11611831.html