whats is mean by class.forName()
whats the return type of class

Answer Posted / jaspal

Class.forName() method is used to load the class in a memory
at runtime. Assume we have a class - aa.bb.DemoClass, then
the method looks like:
Class.forName("aa.bb.DemoClass");

Its return type is a Class object, i.e.
Class classObject = Class.forName("aa.bb.DemoClass");

Now, to create an instance of this class, use
Object object = classObject.newInstance();

Is This Answer Correct ?    26 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does module-relative mean?

577


Are there books about seam?

634


cud u help me ... i am struggling with this question... to find all the subsets of a given set for ex.... a,,b,c shud give all the subsets.... i gt the program in c bt nt able to get it in java..... help needed ..

1737


How database connectivity in XML is achieved?

1769


What are the different types of exception?

572






What is the difference between ear, jar and war file?

576


Which class is the immediate superclass of the menucomponent class?

629


In our urls and in the text of the buttons we have comma. Its causing an error. Is there a way to change the delimiting character for the menu arguments?

587


What are externizable interface?

586


What is Stream Tokenizer?

1732


What is the difference between the string and stringbuffer classes?

545


What is prototype?

613


Describe activation process?

2065


What is difference between object state and behavior?

583


What is ioc concept?

693