class coo
{ public static void main(String[] args)
{
public static void cxx()
{
System.out.print("aaa");
}
 new coo().cxx();
          this.cxx();
  }
}
方法不让包含方法吗??????

解决方案 »

  1.   

    方法应该调用,本类中的用this调用,其他的就要new一个对象再调用了。这样的话程序看起来会好看一点
      

  2.   

    class Coo
    {
        public static void main(String[] args)
       {
    coo.cxx();
       }
       public static void cxx()
       {
         System.out.print("aaa");
       }
     
              this.cxx();
     }
    }
      

  3.   

    class Coo
    {
        public static void main(String[] args)
       {
           Coo.cxx();
           this.cxx();
       }
       public static void cxx()
       {
         System.out.print("aaa");
       }
       public void call()
       {
    }
     
              
     }
    }
      

  4.   

    这里写code太不方便了哦..上面的是意外情况.public class Coo
    {
        public static void main(String[] args)
       {
           Coo.cxx();
           
       }
       public static void cxx()
       {
         System.out.print("aaa");
       }
    }
      

  5.   

    这个啊  现阶段还不行,而且这样看起来也不符合OOP思想