A

Admin • 833.24K Points
Coach

Q. Given that Student is a class, how many reference variables and objects are created by the following code?

Code:
Student studentName, studentId;
studentName = new Student();
Student stud_class = new Student();
  • (A) Two reference variables and two objects are created.
  • (B) Three 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.
  • Correct Answer - Option(B)
  • Views: 29
  • Filed under category Java
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.