如下Class
class A<T>{
public <T> String method1(T t){
return t.toString()+"-"+t.hashCode();
}
}
如下代码
A a = new A();
System.out.println(a.method1(1)); //1
System.out.println(a.method1("hi")); //2
A<String> str = new A<String>();
System.out.println(str.method1(1.1)); //3
答案选几?
A.编译错误 //1
B.编译错误 //1 和 //2
C.编译错误 //1,//2, 和 //3
D.编译错误 //3
E. 1-1
hi-<hashcode值>
1.1--<hashcode值>
F. 运行时抛出异常
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。