45.6k views
1 vote
Public class SavingsAccount extends BankAccount

{ . . . }
Which of the following statements about these classes is correct?
a. There is no relationship between ArrayList and ArrayList
b. ArrayList is a subclass of ArrayList.
c. ArrayList is a subclass of ArrayList.
d. ArrayList extends ArrayList.

User LarssonK
by
7.7k points

1 Answer

5 votes

Final answer:

The correct statement is that ArrayList extends ArrayList.

Step-by-step explanation:

The correct statement about these classes is option d. ArrayList extends ArrayList.

In Java, when one class extends another class, it means that the first class is a subclass of the second class. The subclass inherits the properties and methods of the superclass, and can also define its properties and methods.

In this case, the SavingsAccount class is a subclass of the BankAccount class. This means that SavingsAccount inherits the properties and methods of BankAccount, and can also add its properties and methods.

User Ekalic
by
8.0k points