class SpinCycle2 { public static void main(String[] args) { StringBuilder s = new StringBuilder(); int y=0; System.out.println("faisal#rpm -ivh foo.rpm"); for(int x = 0; x <= 100; x++) { try { if(x%2==0){ s.append("#"); } System.out.print("\r"+x+"%"+s+"|"); Thread.sleep(80); System.out.print("\r"+x+"%"+s+"/"); Thread.sleep(80); System.out.print("\r"+x+"%"+s+"-"); Thread.sleep(80); y = x; } catch(Exception e) { System.err.println(e); } } System.out.print("\r"); System.out.println("\r"+y+"%"+s); System.out.println("faisal#"); } }