希望打印以下字符串 “Press any key to continue. . . /”最后一个'/ '打印出旋转效果,就是 / - \ - 几个字符连续在同一位置显示。请问如何用最简单的方法做到,多谢各位大侠。在线等,马上结帖。

解决方案 »

  1.   

    System.out.print("Press any key to continue. . . |");
            char[] p={'/','-','|','\\'};
            for (int i=0;i<1000;i++){
                System.out.print((char)8);
                System.out.print(p[i%4]);
                try{
                    Thread.sleep(200);
                }catch(Exception ex){
                    ex.printStackTrace();
                }
            }
      

  2.   

    huihui0103() :ASCII码8是“退格”先打个退格,再打一个字符,不就在原来的位置上了吗?
      

  3.   

    System.out.print((char)8);这句是干什么的?
      

  4.   

    回LS上的,ASCII 8 表示BackSpace想了半天啊···看来对ASCII码也要熟悉啊·····学习中