Apple apple = new Apple(); //method 1
Apple.getClass().newInstance(); //method 2
Class.forName("Apple").newInstance(); //method 3
Java实例化一个对象的几个方法
最新推荐文章于 2022-05-07 14:42:22 发布
Apple apple = new Apple(); //method 1
Apple.getClass().newInstance(); //method 2
Class.forName("Apple").newInstance(); //method 3