2013年12月10日星期二

java reflection unusual problem

Class clazz = Class.forName ("com.reflect.Car");
This code throws java.lang.ClassNotFoundException: com.reflect.Car

Car class in this package ah indeed , why not?
------ Solution ---------------------------------------- ----
 This post last edited by the fudongrifdr on 2013-12-10 16:14:29
This code is the same in this package ? Try removing the package name ?
Class.forName ("Car")
------ For reference only ------------------------- --------------
That's all
------ For reference only ---------------------------- -----------
landlord to make sure no wrong ? Including case
------ For reference only ----------------------------------- ----

- ----- For reference only ---------------------------------------
did not pay attention , the code was I moved. .

没有评论:

发表评论