πŸ“Š JAVA
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
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of these

Explanation: 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

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

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
270
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
94%
Success Rate