阅读背景:

是否可以使用Java Reflection创建嵌套类的实例?

来源:互联网 

Sample of code:

代码示例:

public class Foo
{
    public class Bar
    {
         public void printMesg(String body)
         {
             System.out.println(body);
         }
    }
    public static void main(String[] args)
    {
         // Creating new instance of 'Bar' using Class.forname - how?
    }        
}
public class Foo
{
  



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: