Question: Given the following code, which statements are true? Select the two correct answers. (a) Class A extends class B. (b) Class B is the superclass

Given the following code, which statements are true?

class A { protected int valuel; } class B extends A {

Select the two correct answers. 

(a) Class A extends class B. 

(b) Class B is the superclass of class A. 

(c) Class A inherits from class B. 

(d) Class B is a subclass of class A. 

(e) Objects of class A have a field named value2.

(f) Objects of class B have a field named value1.

class A { protected int valuel; } class B extends A { } int value2;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

d and f Given the declaration class B extends A we can ... View full answer

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 Java Programming 8th Questions!