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 |
How do I enable java in google chrome?
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,
What is cdi bean in java?
How do I open the java control panel?
What are the differences between java’s old java date api and java 8’s date and time api?
What is the difference between Object Code and ByteCode? Why do people keep saying that bytecode is like the intermediate of source and object code? Also, which is better/commonly used and why? Please keep in mind that I am a beginner, please keep all terminology fairly simple. Thanks!
What is aop in java?
What is a cookie in java?
Difference between Abstract Class & Interface?
What are the types of cookies in java?
What is the java api?
What is custom tag in java?