Exam Questions and Answers |
Already Graded A+
To override a superclass method in a subclass, the subclass method
____.
A. Must use a different method name.
B. Must use the same method name and the same parameter types.
C. Must use a different method name and the same parameter types.
D. Must use a different method name and different parameter types. -
ANSWER ✔✔B. must use the same method name and the same
parameter types
, public interface Sizable
{
int LARGE_CHANGE = 100;
void changeSize();
}
Which of the following indicates how to use the constant
LARGE_CHANGE in your program?
A. LARGE-CHANGE
B. Sizable.LARGE_CHANGE
C. Sizable(LARGE_CHANGE)
D. you cannot directly use the LARGE_CHANGE constant in your
program - ANSWER ✔✔B. Sizable.LARGE_CHANGE
public class BankAccount implements Comparable<BankAccount>
{
public int compareTo(T other)
{
What is wrong with this code?