I have to update my console.
Here is an example code:
public class Tester {
public static void main(String[] args) {
System.out.print("abcd\n");
System.out.print("efgh");
System.out.print("\r\r\rijkl");
}
}
My output:
abcd
ijkl
Expected output :
ijkl
efgh
I'm also tried this:
System.out.print("abcd\n");
System.out.print("efgh\n");
System.out.print("\033[0;0H");//\033[0;0H is an escape sequence to positioning the console cursor(Referred From Internet).
System.out.print("ijkl");
For the above Code the output is :
abcd
efgh
←[0;0Hijkl
While I try online compiler the above code working fine. see here
But it is not working in windows and linux OS
Please Tell me What change i have to make to get my expected output.
Thank you all.