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");

a. I only
b. II only
c. I and II only
d. I and III only
e. I, II, and III



Answer :

Other Questions