1, If a method is declared private in the superclass, you may declare the method
ID: 3909144 • Letter: 1
Question
1, If a method is declared private in the superclass, you may declare the method public in the subclass.
true
false
2, Which of the following statements are true?
A method can be overloaded in the same class.
A method can be overridden in the same class.
If a method overloads another method, these two methods must have the same signature.
If a method overrides another method, these two methods must have the same signature.
A method in a subclass can overload a method in the superclass.
3, If a method is declared protected in the superclass, you may declare the method private in the subclass.
true
false
4, Given two reference variables t1 and t2, if t1 == t2 is true, t1.equals(t2) must be ________.
true
false
Explanation / Answer
1) false 2) A method can be overloaded in the same class. If a method overrides another method, these two methods must have the same signature. A method in a subclass can overload a method in the superclass. 3) true 4) true
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.