If I input whitespace from console , console print this as a string . but, if I do it directly, it works correctly . why ? How can I print whitespace as a whitespace from console input?
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Input Whitespace :");
String ss = sc.nextLine();//input whitespace from console
String st ="\n \t";//input whitespace directly
System.out.println("print whitespace direcly :"+st+"print whitespace from console : "+ss);
}
input : Input Whitespace :\n \t
output : print whitespace direcly : print whitespace from console : \n \t