Java遗传学翻译 [英] the java genetics traslation
本文介绍了Java遗传学翻译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
public class Erased<T> {
private final int SIZE = 100;
public static void f(Object arg) {
if(arg instanceof T) {} // Error
T var = new T(); // Error
T[] array = new T[SIZE]; // Error
T[] array = (T)new Object[SIZE]; // Unchecked war
}
}
///:〜任何人都可以告诉我在compile_time上将翻译什么代码.如果参考类型擦除,那么如何?谢谢!
///:~ anyone can tell me what will the code be translated at compile_time.If refer to Type erasure,how?Thanks!
推荐答案
检查此链接.这只是您要查找的信息:
http://docs.oracle.com/javase/tutorial/java/generics/erasure.html [^ ]
祝你好运!
Check this link. It is just the info you are looking for:
http://docs.oracle.com/javase/tutorial/java/generics/erasure.html[^]
Good luck!
这篇关于Java遗传学翻译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文