日期:2014-05-20 浏览次数:20930 次
import java.util.*; public class TestClassForName { public static void main(String[] args) { Class c1 = Class.forName("java.util.Date"); } }
java.util.Date d = new java.util.Date();
import java.util.*; public class TestClassForName { public static void main(String[] args) { try { Class c1 = Class.forName("java.util.Date"); } catch (ClassNotFoundException e) { e.printStackTrace(); } } }