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 the difference between a checked and an unchecked exception?

541


What is data object example?

525


Is sizeof a keyword in java programming?

599


What happens if I remove static from main method?

515


What is multithreading and its advantages?

565






What does the exclamation mark mean in java?

586


What is static block?

580


Explain the importance of join() method in thread class?

634


Can we define private and protected modifiers for the members in interfaces?

529


What is the size of integer?

579


Can I overload to string method

960


What is the maximum size of byte array in java?

530


What is off heap memory?

542


Where is core java used?

569


Does java have extension methods?

517