请在每条横线处填写一个语句,使程序的功能完整,且输出结果为911。 注意:请勿改动main()主方法和其他已有的语句内容,仅在横线处填入适当的语句。 public class Outer { public

admin2009-01-15  20

问题 请在每条横线处填写一个语句,使程序的功能完整,且输出结果为911。
   注意:请勿改动main()主方法和其他已有的语句内容,仅在横线处填入适当的语句。
       public class Outer
       {
        public static void main(String args[])
        {
         Outer i=new Outer();
         i.taskInner();
        }
        public class lnner
        {
         private int size;
         public void doSomething(int size)
           {
            __________//访问局部变量
            this.size++;//访问内部类的成员变量
            __________//访问外部类的成员变量
            System.out.println(size+" "+this.size+" "+Outer.this.size);
           }
       }
       public void tasklnner()
            {
             __________
             k.doSomething(8);
            }
       private static int size;
      }

选项

答案size++; Outer.this.size++; Inner k=new lnner();

解析
转载请注明原文地址:https://kaotiyun.com/show/hGnp777K
0

随机试题
最新回复(0)