Joke Collection Website - Blessing messages - The difference between ClassNotFoundException and NoClassDefFoundError
The difference between ClassNotFoundException and NoClassDefFoundError
ClassNotFoundException and NoClassDefFoundError, both of which seem to be exceptions caused by the inability to find the class, but one is an Exceptioin exception and the other is an Error error. By comparing them, we can understand the difference between Error and Exception. .
ClassNotFoundException is an Exception that is generally encountered during reflection. It is an error caused by dynamic loading. Dynamic loading is a business logic deliberately designed by developers, and it has the possibility of failure, so it is recommended to catch it.
NoClassDefFoundError is an Error. When this error occurs, there is no problem during compilation. However, at runtime, when the JVM or ClassLoader loads a certain class and finds that the class cannot be found, this error will be reported. . This is generally a problem with the operating environment, such as a lack of library files or something. This error has nothing to do with business logic and is an error that must be resolved. Otherwise, the software cannot continue to run, so it is not recommended to capture it.
- Related articles
- Who did He San, the voice of China, choose?
- Parameter Configuration of Huawei m 10 Mobile Phone
- What should I do if I can't confirm it by texting?
- How do you say thank you when you receive a red envelope at the wedding?
- What messy health messages do mobile phones often receive? How to turn them off?
- What do ants, elephants, mobile phones and lighters have in common?
- How to send a Sony Ericsson lt 15i message to others?
- Apple 6s can't receive the information sent by Apple mobile phone and other mobile phone information without opening the cellular network.
- Jay Chou stood on the front line of Korea, saying many times that Chinese music is the best. Why don't many netizens accept it?
- What's the number of China Mobile SMS Center?