从java-me内部类调用其他实例方法

时间:2011-02-28 05:15:56

标签: java blackberry java-me

public class Outer 
{
     Grid g=new Grid();
     public class Inner
     {
         // how do I call a grid class function from this inner class?
     }
}

public class Grid
{
     Grid(){}
     void up(){}
}

1 个答案:

答案 0 :(得分:2)

public class Outer 
{
     Grid g=new Grid();

     public class Inner
     {
         public void callG()
         {
             g.up();
         }
     }
}