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 does string [] args mean?

551


What is the collections api in java programming?

565


What are keywords give examples?

588


What does || mean in code?

550


Explain about arraylist?

589






Can static methods access instance variables in java?

581


What are the important features of Java 11 release?

592


What is console based application in java?

554


What is jar?

641


What are different types of classloaders?

597


What is final?

614


Can we declare a class as static?

603


What is array sorting in java?

563


Which is fastest collection in java?

572


What is the difference between static binding and dynamic binding?

577