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 null in java?

699


What is default constructors?

717


Is java code slower than native code?

758


What is java string pool?

760


Tell us something about set interface.

755


What is the use of default method in interface in java? Explain

742


There are two classes named classa and classb. Both classes are in the same package. Can a private member of classa can be accessed by an object of classb?

1229


Is oracle java 11 free?

704


What is difference between pointer and reference?

716


What is the use of volatile in java?

803


Difference between arraylist and hashset in java?

767


23. Storage space in java is of the form Stack Queue Heap List 24. What is java code embedded in a web page known as Applets Servlets scriptlets snippets 25. Which of the following attributes are compulsory with an tag?. code,height & width. 26. What does 'CODEBASE' in an applet tag specify?. Files absolute path.

2254


What is the difference between path and classpath variables?

714


What is the purpose of the system class in java programming?

745


What is stack explain?

682