2020
10-08
10-08
浅谈java运用注解实现对类中的方法检测的工具
创建自定义注解@Retention(RetentionPolicy.RUNTIME)@Target(ElementType.METHOD)public@interfaceTest{}建立测试类publicclassUserTest{@TestpublicvoidtestInsert(){Useruser=null;System.out.println(user.getUsername());}@TestpublicvoidtestQuery(){Blogb=newBlog();b.setTips(newString[]{"技术","java","多线程"});String[]tips=b.getTips();System.out.println(tips[3]);}...
继续阅读 >