java 5 桥接方法
java 5 泛型导致的桥接方法(转载)
?
原文链接?http://berdy.iteye.com/blog/810488
?
abstract class A<T> {abstract T get(T t);}class B extends A<String> {@OverrideString get(String s) {return "";}}
?实际是
abstract class A {abstract Object get(Object obj);}class B extends A {//编译器添加的方法Object get(Object s) {return (Object) get((String) s);}String get(String s) {return "";}}
?
?