Amaru Shakur wrote:
without having to worry about double \\ing to do the escape sequences for java.
actually it works im suprised. why is that does the scanner know to catch the escape sequences for me?
The "\\ing" is required by the compiler in the definition of string literals -- as the backslash has special meaning. It is not needed when string literals are not involved. This means that you don't need it if the string is to be read from a file, read from a network source, or read from standard in via the scanner.
The scanner doesn't know how to catch the escape sequences -- it is just not an issue.