There is one visible difference is that, where Class.forName(String className) method is static method of java.lang.Class class, in other hand, ClassLoader.LoadClass(String className) method is instance method (non-static method). Therefore, if you want to use and call ClassLoader.LoadClass(String className) method, you need any java.lang.ClassLoader instance to load any class with this method.
Here you can see more differences with really good blog on this topic
Click Here http://www.somanyword.com/2013/12/difference-between-class-forname-and-classloader-loadclass-methods-in-java/
1 Comments:
There is one visible difference is that, where Class.forName(String className) method is static method of java.lang.Class class, in other hand, ClassLoader.LoadClass(String className) method is instance method (non-static method). Therefore, if you want to use and call ClassLoader.LoadClass(String className) method, you need any java.lang.ClassLoader instance to load any class with this method.
Here you can see more differences with really good blog on this topic
Click Here http://www.somanyword.com/2013/12/difference-between-class-forname-and-classloader-loadclass-methods-in-java/
Post a Comment
<< Home