Q. Which of the following is a method having same name as that of its class?
β
Correct Answer: (D)
constructor
Dear candidates you will find MCQ questions of JAVA here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.
Share your questions by clicking Add Question
Explanation: new keyword is used to create object of class. For example:
Class Student {
//Some code
}
Student stu1 = new Student();
This will create an object of class Student.