J2SE 1.4 ã§æ¸ããããããã㨠Class fooClass = Class.forName("Foo"); Foo fooObject = (Foo)fooClass.newInstance(); ããã generics ã使ã£ã¦ã¹ãã¼ãã«æ¸ãããï¼ æ¡1 Class<Foo> fooClass = (Class<Foo>)Class.forName("Foo"); Foo fooObject = fooClass.newInstance(); ãã£ã¹ããå ¥ã£ã¦ããæç¹ã§ generics ãã¹ãã¼ãã«ä½¿ã£ã¦ããªãï¼ æ¡2 Class<?> fooClass = Class.forName("Foo"); Foo fooObject = fooClass.newInstance(); ã³ã³ãã¤ã«ã¨ã©ã¼ï¼? 㨠Foo ã¯äºæãããªãï¼ ã§ç ®è©°ã¾ã£ã¦æ¤ç´¢ãã¦ã¿ãã¨ãã
{{#tags}}- {{label}}
{{/tags}}