Example & Tutorial understanding programming in easy ways.

What is Dynamic Class Loading using java Reflection Api ?

Dynamic Class Loading
This java example shows how to load a class dynamically. It obtains a ClassLoader and makes a call to its loadClass() method.

class Test {

}

public class ClassLoading {

public static void main(String[] args) {

ClassLoader cl = ClassLoading.class.getClassLoader();

try {

Class c = cl.loadClass("Test");

System.out.println("c.getName() = " + c.getName());

} catch (Exception e) {

System.out.println("Exception: " + e.toString());

}

}

Read More →
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!