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
Why map is used in java?
Can we create an object of private class?
What does sizeof return?
What is singleton class and how can we make a class singleton?
What is a functional interface?
What are some characteristics of interference class?
How many tetrahedral voids are there in bcc?
What is an object in java?
How do you test a method for an exception using junit?
how to create multithreaded program? Explain different ways of using thread? When a thread is created and started, what is its initial state? Or extending thread class or implementing runnable interface. Which is better? : Java thread
What are the restrictions imposed by a Security Manager on Applets?.
What is java util hashmap?
What is return keyword in java?
If a class is declared without any access modifiers, where can the class be accessed?
Can sleep() method causes another thread to sleep?