Question: public class Book { private String author; private String title; public Book(String the_author, String the_title) { author = the_author; title = the_title; } } public
public class Book
{
private String author;
private String title;
public Book(String the_author, String the_title)
{
author = the_author;
title = the_title;
}
}
public class Textbook extends Book
{
private String subject;
public Textbook(String the_author, String the_title, String the_subject)
{
/* missing implementation */
}
}
Which of the following can be used to replace /* missing implementation */ so that the Textbook constructor compiles without error?
-
A) author = the_author;
title = the_title;
subject = the_subject;
-
B) super(the_author, the_title);
-
super(the_subject);
-
C) subject = the_subject;
super(the_author, the_title);
-
D) super(the_author, the_title);
subject = the_subject;
-
E) super(the_author, the_title, the_subject);
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
