How to create an instance of a class without using "new"
operator? Plz help me out properly.Thank u.

Answer Posted / saravanan p

By using Class d=Class.forName("className");
Object obj=c.newInstance();

Is This Answer Correct ?    77 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are 5 boolean operators?

824


What super () does in java?

668


What is difference between static class and normal class?

743


What is xslt in java?

725


Can subclass overriding method declare an exception if parent class method doesn't throw an exception?

742


What is the purpose of void class?

800


What is java reflection?

737


how to create multithreaded program? Explain different ways of using thread? When a thread is created and started, what is its initial state? Or extending thread class or implementing runnable interface. Which is better? : Java thread

795


What will happen if a thrown exception is not handled?

744


What defines function?

735


What are some examples of variable costs?

701


Why is singleton instance static?

721


Can we have more than one package statement in source file ?

767


Define how destructors are defined in java?

759


What is purpose of keyword void?

798