There are 2 different ways to create an object. a)By using
keyword "new" b)By using Class.forName
("className").newInstance();
What is the difference between these 2 methods.

Answer Posted / ratnesh gupta

the first way to create an object is 'class name object
name'and the secondone is classNameAsArgument").newInstance
();

Is This Answer Correct ?    2 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is pre increment and post increment in java?

502


What is the collections api?

573


What is the old name of java?

505


What is the difference between Java and C++?

615


What is a double vs float?

538






What do you mean by chromounits in java8?

528


How do weakhashmap works?

591


Is there any case when finally will not be executed?

524


What are java packages?

586


What is final method?

582


What are the limitations of procedural programming approach?

528


What is the difference between preparedstatement and statement in java?

553


How destructors are defined in java?

630


What is anonymous inner class?

611


How infinite loop is declared?

538