How to move a character from left to right on the console screen in Java

1 Answer

0 votes
public class MoveChar {
    public static void main(String[] args) throws InterruptedException {
        for (int x = 0; x < 50; x++) {
            System.out.print("\r" + " ".repeat(x) + "@");
            Thread.sleep(80);
        }
        System.out.println();
    }
}



/*
run:
 
                    @
 
*/

 



answered 20 hours ago by avibootz
...