JAVA问题03

来源:百度知道 编辑:UC知道 时间:2024/07/05 14:20:32
QUESTION NO: 3
1. class A {
2. protected int method1(int a, int b) { return 0; }
3. }
Which two are valid in a class that extends class A? (Choose two)
A. public int method1(int a, int b) { return 0; }
B. private int method1(int a, int b) { return 0; }
C. private int method1(int a, long b) { return 0; }
D. public short method1(int a, int b) { return 0; }
E. static protected int method1(int a, int b) { return 0; }
-------------------------------------------------------------
BC不能选了吧
C是为什么啊

C. private int method1(int a, long b) { return 0; }
A. public int method1(int a, int b) { return 0; }

C这个叫方法的重构,参数不一样了。希望我说的没错,我对理论的一些知识掌握的并不扎实。

欢迎广大java爱好者加入群一起讨论:30745246