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
What is use of inner class in java?
How do you check if two given string are anagrams?
Who found java?
Can we declare main () method as non static?
How would you dynamically allocate memory to an array?
what are the states associated in the thread? : Java thread
Is null an object in java?
What is difference between add() and addelement() in vector?
How to check if a list is sorted in java?
What is static import?
Is string pool garbage collected?
Is class forname reflection?
What are jee technologies?
What is thread safe in java?
How many types of keywords are there?