Answer Posted / madhu
public class MainClass {
public static void main(String[] args){
ClassLoader classLoader = MainClass.class.getClassLoader();
try {
Class aClass = classLoader.loadClass("com.tech.MyClass");
System.out.println("aClass.getName() = " + aClass.getName());
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
| Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
What if I write static public void instead of public static void?
What is a dao layer in java?
Why do we only use the main method to start a program?
Are jvm’s platform independent?
What is cache in java?
What is mime in java?
What is injection in java?
Why sun introduce concept of anonymous class? What is need and real life use of anonymous class
What is meant by annotation in java?
Why do we need new date and time api in java se 8?
What is lambda expression in mvc?
What is the difference between collection and stream?
How do I create an executable jar file?
What is csrf in java?
Why do we create dto in java?