Question: Consider the following class declaration. A 1 3 - line code segment reads as follows. Line 1 : public class Student. Line 2 : open

Consider the following class declaration.
A 13-line code segment reads as follows.
Line 1: public class Student.
Line 2: open brace.
Line 3: private String my Name, semicolon.
Line 4: private int my Age, semicolon.
Line 5: blank.
Line 6: public Student, open parenthesis, close parenthesis.
Line 7: open brace, forward slash, asterisk, implementation not shown, asterisk, forward slash, close brace.
Line 8: blank.
Line 9: public Student, open parenthesis, String name comma int age, close parenthesis.
Line 10: open brace, forward slash, asterisk, implementation not shown, asterisk, forward slash, close brace.
Line 11: blank.
Line 12: forward slash, forward slash, No other constructors.
Line 13: close brace.
Which of the following declarations will compile without error?
Student a = new Student();
Student b = new Student("Juan",15);
Student c = new Student("Juan","15");
Responses
I only
I only
II only
II only
I and II only
I and II only
I and III only
I and III only
I, II, and III

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!