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 line code segment reads as follows.
Line : public class Student.
Line : open brace.
Line : private String my Name, semicolon.
Line : private int my Age, semicolon.
Line : blank.
Line : public Student, open parenthesis, close parenthesis.
Line : open brace, forward slash, asterisk, implementation not shown, asterisk, forward slash, close brace.
Line : blank.
Line : public Student, open parenthesis, String name comma int age, close parenthesis.
Line : open brace, forward slash, asterisk, implementation not shown, asterisk, forward slash, close brace.
Line : blank.
Line : forward slash, forward slash, No other constructors.
Line : close brace.
Which of the following declarations will compile without error?
Student a new Student;
Student b new StudentJuan;
Student c new StudentJuan;
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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
