单项选择题
A. [1,2,3]
B. [1,2,2,3]
C. [1,2,3,3]
D. [2,1,3,2]
单项选择题 程序员正在进行一个项目,必须实现equals方法与所给的hashCode方法协调运行:() public int hashCode() { return (size.hashCode() + color.hashCode()) * 17; } 哪一个equals方法支持此目标?()
单项选择题 1. class Alpha { void m1() {} } 2. class Beta extends Alpha { void m2() { } } 3. class Gamma extends Beta { } 4. 5. class GreekTest { 6. public static void main(String [] args) { 7. a Alpha [] a = {new Alpha(), new Beta(), new Gamma() }; 8. for(Alpha a2 : a) { 9. a2.m1(); 10. if (a2 instanceof Beta || a2 instanceof Gamma) 11. //insert code here 12. } 13. } 14. } 哪一行代码插入到第11行,将编译但是会在运行时产生异常?()
单项选择题 程序: class MyDate{ private int year; private int month; private int day; public MyDate( int year, int month,int day){ this.year=year; this.month=month; this.day=day; } //Override Method } 为了让new MyDate(1980,11,9)==(判断是否相等)new MyDate(1980,11,9) 返 回true,必须在Override Method处覆盖哪个方法?()