R

Ram Sharma • 193.84K Points
Coach

Q. Which of the following ways is the correct way to create an object in Java?

  • (A) Using the new keyword
  • (B) Using newInstance() method
  • (C) clone() method
  • (D) All of these

Explanation by: Team MCQ Buddy
All of the above-mentioned ways are the correct way to create an object Java.

There are five different ways to create an object and we will see the ways to create an object given below:

Using the new keyword
Using newInstance() method of Class
Using clone() method
Using newInstance() method of Constructor class
Using deserialization

You must be Logged in to update hint/solution

Discusssion

Login to discuss.