Java Puzzler
does the following code compile?
public class Puzzler {
<T> T cast(T t, Class<T> clazz) {
return clazz.cast(t);
}
<T> T nop(T t) {
return cast(t, t.getClass());
}
}
尽心知性知天
does the following code compile?
public class Puzzler {
<T> T cast(T t, Class<T> clazz) {
return clazz.cast(t);
}
<T> T nop(T t) {
return cast(t, t.getClass());
}
}