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());
}
}



posted on 2012-03-16 23:47  grep  阅读(144)  评论(0编辑  收藏  举报