以ä¸ã®sourceã¯compileãéãã§ããããï¼ public class Xmas { <T> T func1() { return this.func2(); } <T> T func2() { return null; } } 試ãã«ã³ã³ãã¤ã«ãã¦ã¿ã㨠yone098>javac Xmas.java Xmas.java:6: åãã©ã¡ã¼ã¿ <T>T ãå¤å¥ã§ãã¾ãã; åå¤æ° T (ä¸é T,java.lang.Object) ã®åºæã®æ大ã¤ã³ã¹ã¿ã³ã¹ãåå¨ãã¾ããã return this.func2(); ^ ã¨ã©ã¼ 1 å Eclipseã§OKãªã®ã«ãmvnã§ã³ã³ãã¤ã«åºæ¥ãªãã¨ããçµé¨ããæ¹ãããã®ã§ã¯ãªãã§ããããã åãã©ã¡ã¼ã¿Tããããå¤å¥åºæ¥ããããã¨æãã¾ãããåºæ¥ãªãåã§ãã ããåãã£ãæ¹ã¯ãSunã®JDKããã¢ã§ããã ããããã¨ãã¯ã以ä¸ã®ããã«å¤æ´ã
{{#tags}}- {{label}}
{{/tags}}