testredgeneral.java

来自「Java程序设计课后练习题题目的相关练习答案」· Java 代码 · 共 21 行

JAVA
21
字号
package finalexam;
public class testRedGeneral {
    public static void  main(String[] argc){
        System.out.println("start test");
        RedGeneral a = new RedGeneral();
        System.out.println(a.toString());
        try{a.move(-1,0);}catch(Exception e)
            {System.out.println(e.getMessage());}
        System.out.println(a.toString());
        try{a.move(0,1);}catch(Exception e)
            {System.out.println(e.getMessage());}
        System.out.println(a.toString());
        try{a.move(1,-1);}catch(Exception e)
            {System.out.println(e.getMessage());}
        System.out.println(a.toString());
        try{a.move(-1,0);}catch(Exception e)
            {System.out.println(e.getMessage());}
        System.out.println(a.toString());
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?