给ml一个返回值,
在m2中根据m1的返回值判断是否继续执行

解决方案 »

  1.   

    在ml中加入抛出异常:
    class test throws Exception{
       void m1(){
       int 1=0;
       if(某条件){
           throw new Exception("not process");
    }
    void m2(){
        try{
             m1;
             其它语句
       }catch(Exception e){
       }
    }
      

  2.   

    void m1(){
    int 1=0;
    //次处为其它语句,请问如何在这个地方使程序不继续执行m2方法中的其它语句
    if(被m2调用) return;
    }
      

  3.   

    class test{
    void m1(){
    int 1=0;
    次处为其它语句,请问如何在这个地方使程序不继续执行m2方法中的其它语句
    }
    void m2(){
    m1;
    其它语句
    }
    方法有多种,一种可以用System.exit(0);来直接退出程序
                也可以用异常来处理,人为的抛出异常!