when we write class.forName("any one class"); what happens
actually?what it will return?explain stepwise?
Answer Posted / paras
Class.forName("")loads that class in memory ,to create
instance we have to use newInstance()
string _path="classpath loc of class XYZ ex com.aa.ss.XYZ";
Object ob=Class.forName(_path).newInstance();;
((XYZ)ob).any_method_of_XYZ();
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
If we allocate the memory using 'new' & de-allocated using 'free' then what will happen?
when you will synchronize a piece of your code? : Java thread
What are the benefits of immutable objects?
Explain the difference between abstract class and interface in java?
Explain importance of finally block in java?
Define class?
What is the purpose of the strictfp keyword?
What is the significance of listiterator?
Can we use synchronized block for primitives?
What is the difference between an argument and a parameter?
when should you use stringbuilder class in a program?
What is the difference between stringbuffer and stringbuilder class?
Which collections are thread safe in java?
How the interruptible method gets implemented?
how to write a server program and sending the mails to the server using smtp protocol please help me