How to load a class programmatically?
Answer / 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 |
why is java not 100% oops?
What is gwt in java?
What is jpa implementation?
What is a flatmap?
How do I run a java program from the command line?
What is entitymanager in jpa?
Is lambda cheaper than ec2?
Explain the Sequence Diagram?
In java thread programming, which method is a must implementation for all threads?
How many types of jdk are there?
Why we need method overriding in JAVA ? I mean which method I have to override I can write that method in my Class.
program A and B are analysed and found to have worst case running time greater than 150NlogN and N*N respectively. which program has the better guarantee after the running time for the large values of N(N>10000)? which program has the better guarantee for the running time of small program N (N<100)? which program will run faster on average for N=1000?
0 Answers St. Pauls University,