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
How do I create an executable jar file?
What is the use of flatmap?
Is lambda cheaper than ec2?
Why do we only use the main method to start a program?
Is openjdk the same as jdk?
How do I install jdk?
What does @override mean in java?
Which is more secure: java or activex? : java security
Which version of jdk is required for netbeans 8.0 2?
What is cloning in java?
How can I swap two variables without using a third variable?
What is the point of lambda expressions?
Can the main method be overloaded?
What are anonymous methods and lambda expression?
What do you understand by numeric promotion?