Programming MCQS - QUESTION DETAILS

How do you create an object of a class in Java?
A. Object obj = new Object();
B. class obj = new class();
C. Object obj = createObject();
D. obj = createObject();

'new' is used to create an object of a class in Java.

Similar Questions

What is the role of the 'super' keyword in Java?






What is the purpose of the 'super()' constructor in Java?






Which method is called automatically when an object is garbage collected?






What is the purpose of the 'this' keyword in Java?






What is the role of the 'static' keyword in Java?






What is the output of System.out.println(10 / 3.0);?






What is the purpose of the 'finalize' method in Java?






Which of the following is not a primitive data type in Java?






What is the output of System.out.println("Java" == "Java");?






What is the entry point for the execution of a Java program?