logo

目录

注解

使用注解

什么是注解(Annotation)?注解是放在Java源码的类、方法、字段、参数前的一种特殊“注释”:
// this is a component: @Resource("hello") public class Hello { @Inject int n; @PostConstruct public void hello(@Param String name) { System.out.println(name); } @Override public String toString() { return "Hello"; } }
本章目录
    1v1免费职业咨询