I am new to java and I just want to know how to perform the "clear screen" in it just like in C. I am currently using IntellijIdea IDE. So, does it require any sort of plugins? since I have already tried this one:
System.out.print("\033[H\033[2J");
System.out.flush();
This not giving me any result. Actually, this what I am trying to do by implementing the below code:
import java.util.*;
public class ScreenClear {
public static void main(String[] args) {
System.out.println("Hello world ");
System.out.println("New to JAVA PROGRAMMING");
System.out.println("Please tell me how to clear the screen");
new Scanner(System.in).nextLine(); // Using like getch
System.out.print("\033[H\033[2J");
System.out.flush();
}
}
But after executing this I am not getting the desired result. Please provide some tips.