【摘要】 JAVA反射学习
Class cls = Class.forName(“xxx.com.user”);
Constructor constructor = cls.getConstructor();
Object obj = constructor.newInstance();
System.out.println(obj);
1234
JAVA依赖
每个模块都需…
JAVA反射学习
Class cls = Class.forName("xxx.com.user");
Constructor constructor = cls.getConstructor();
Object obj = constructor.newInstance();
System.out.println(obj);
JAVA依赖
每个模块都需要写 module-info.java
module common {
export xxx.com.utils; // 编译和运行时 --> exports 表示这两个时期 都可以对外提供
import xxx.com.services;
opens xxx.com.bussiness; // 只能通过运行时 通过反射操作,来获取当前类 进行创建对象操作
}
函数式编程
1、函数接口 – >接口内部只有一个抽象方法的接口
2、lamda 表达式
文章来源: blog.csdn.net,作者:pengnf,版权归原作者所有,如需转载,请联系作者。
原文链接:blog.csdn.net/ningfeng8899/article/details/116399596
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END