Student stud_class = new Student();
A. Three reference variables and two objects are created.
B. Two reference variables and two objects are created.
C. One reference variable and two objects are created.
D. Three reference variables and three objects are created.
Answer:A
Student stud_class = new Student();
A. Three reference variables and two objects are created. B. Two reference variables and two objects are created. C. One reference variable and two objects are created. D. Three reference variables and three objects are created.
Explanation: In the above code, there are three reference variables and two objects. The studentName, studentId, and stud_class are the three reference variables. The objects are those variables that are created using the new operator, i.e., studentName and stud_class. The studentId is only a reference variable as it is not declared using the new operator. Both studentName and stud_class are reference variables as well as objects.