Click here to watch in Youtube :
https://www.youtube.com/watch?v=LK9Ioh54kTM&list=UUhwKlOVR041tngjerWxVccw
Click the below Image to Enlarge
Java Tutorial : Java Exception handling (ClassNotFoundException vs NoClassDefFoundError) |
Java Tutorial : Java Exception handling (ClassNotFoundException vs NoClassDefFoundError) |
Java Tutorial : Java Exception handling (ClassNotFoundException vs NoClassDefFoundError) |
public class ClassNotFoundExceptionDemo { public static void main(String[] args) { try { Class.forName("oracle.jdbc.driver.OracleDriver"); } catch (ClassNotFoundException e) { e.printStackTrace(); } } }
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at ClassNotFoundExceptionDemo.main(ClassNotFoundExceptionDemo.java:9)B.java
class A { } public class B { public static void main(String[] args) { A a=new A(); } }
Exception in thread "main" java.lang.NoClassDefFoundError: A at B.main(B.java:11) Caused by: java.lang.ClassNotFoundException: A at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 1 more
https://sites.google.com/site/javaee4321/java/ExceptionDemo_CNFE_NCDFE_App.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava/ExceptionDemo_CNFE_NCDFE_App
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/4babce59a384cb4ab41f12b03cd7d11227a4b186/BasicJava/ExceptionDemo_CNFE_NCDFE_App/?at=master
See also:
Nice Lecture. Also check java training
ReplyDeletejava online training
Say, you got a nice article post.Really thank you! Really Great.
ReplyDeletedata science course in hyderabad
data science training in hyderabad
Hi! I really like your content Your post is really informative.
ReplyDeleteBest Machine Learning Course in Bangalore