/* Demonstration of '\r' usage CIS 160 David Klick 2015-09-09 Displays a spinner on the screen using a carriage return, a delay, and a array of characters to display. */ public class TestSpin { public static void main(String[] args) throws InterruptedException { String spin = "|/-\\"; for (int i=0; i<100; i++) { System.out.print("\r" + spin.charAt(i%4)); Thread.sleep(200); } } }