DebugBoy

导航

2019年5月17日 #

Class.forName()、Class.forName().newInstance() 、New 三者区别

摘要: 在Java开发特别是数据库开发中,经常会用到Class.forName( )这个方法。通过查询Java Documentation我们会发现使用Class.forName( )静态方法的目的是为了动态加载类。在加载完成后,一般还要调用Class下的newInstance( )静态方法来实例化对象以便 阅读全文

posted @ 2019-05-17 11:27 DebugBoy 阅读(2550) 评论(0) 推荐(0)