Which of the following statements are true?

a. To override a method, the method must be defined in the subclass using the same signature and compatible return type as in its superclass.
b. Overloading a method is to provide more than one method with the same name but with different signatures to distinguish them.
c. It is a compile error if two methods differ only in return type in the same class.
d. A private method cannot be overridden. If a method defined in a subclass is private in its superclass, the two methods are completely unrelated.
e. A static method cannot be overridden. If a static method defined in the superclass is redefined in a subclass, the method defined in the superclass is hidden.


a. To override a method, the method must be defined in the subclass using the same signature and compatible return type as in its superclass.
b. Overloading a method is to provide more than one method with the same name but with different signatures to distinguish them.
c. It is a compile error if two methods differ only in return type in the same class.
d. A private method cannot be overridden. If a method defined in a subclass is private in its superclass, the two methods are completely unrelated.
e. A static method cannot be overridden. If a static method defined in the superclass is redefined in a subclass, the method defined in the superclass is hidden.

Computer Science & Information Technology

You might also like to view...

The Logo button is found in the Header & Footer group on the ________ tab

A) Page Setup B) Design C) Format D) Arrange

Computer Science & Information Technology

Visual Basic for Applications (VBA) is the programming language you use to record a macro

Indicate whether the statement is true or false

Computer Science & Information Technology

When a cell or a group of cells is copied and then pasted into a new location, the formatting and underlying values of the original cell are pasted

Indicate whether the statement is true or false.

Computer Science & Information Technology

This type of mouse emits and senses light to detect mouse movement.

A. wireless B. cordless C. optical D. mechanical

Computer Science & Information Technology