bacor

个人站

Coding is important, so is writing


注解

使用注解为我们在代码中添加信息提供了一种形式化的方法,使我们可以在稍后某个时刻非常方便的使用这些数据。 java有三个内置注解

  • @Override
  • @Deprecated
  • @SuppressWarnings

基本语法

注解的语法与修饰符的使用几乎一样 元注解:

  • @Target
  • @Retention
  • @Documented
  • @Inherited