Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Donald A. Carpenter Fred R. McFadden

1st Edition

8178088045, 978-8178088044

More Books

Students also viewed these Databases questions