å¯ããã¨æã£ããæãã¤ããã public class Main { public static void main(String...args) { Comparable<?>[] c = method(1, 1L); } static <T> T[] method(T...ts) { return ts; } } ãããjavacã§è¦åã§ãªããã©å®è¡ããã¨ClassCastExceptionçºçãè¨èªä»æ§éåã§ãã ãããããnew T[ ]ããã¨ãã«reifiableãªåã®é åä½ããã¨ãã¦ã¤ã¬ã¤ã¸ã£å¤æããã¦ãã(erase(lub(Integer, Long)) = erase(Number & Comparableï¼...ï¼) = Number ã¨ãã¦ãã)ã®ã«ãæ»ãå¤ã«ããä¼æããã¦ãªãã¦T[ ]ã®ã¾ã¾ä½¿ã£ã¦ãã ææ¥ã¾ã¨ããªããäºå®ã
{{#tags}}- {{label}}
{{/tags}}