Why isn’t “n” interpreted as newline character when a String like, “abcnabc” is given as input via Scanner class in Java?
In Java, when we try to print a Hardcoded String like, “abcnabc”, we observe a line change after the first abc but when we take same input via sc.next() or sc.nextLine() it prints out ‘n’ as the part of string itself without any line change.