Posted on 2011-09-08 08:59
itspy 閱讀(339)
評(píng)論(0) 編輯 收藏
ClassNotFoundException
當(dāng)你通過
字符串加載一個(gè)Class時(shí),如果出錯(cuò)了就會(huì)拋出這個(gè)異常.比如.
The forName
method in class Class
.The findSystemClass
method in class ClassLoader
.The loadClass
method in class ClassLoader
ClassNotFoundException
如果程序在運(yùn)行過程中,比如構(gòu)造函數(shù)new一個(gè)對(duì)象時(shí),觸發(fā)加載操作了而沒有找到對(duì)象.就會(huì)拋出這個(gè)異常.
詳情可以參考:
http://stackoverflow.com/questions/1457863/what-is-the-difference-between-noclassdeffounderror-and-classnotfoundexception