This question already has an answer here:
- What is the backslash character (\\)? 6 answers
I want to print out a backslash. However, I get an error:
//Invalid escape sequence (valid ones are \b \t \n \f \r \" \' \\ )
System.out.println("\");
System.out.println("\\");
\
will escape the second \ character.
来源:https://stackoverflow.com/questions/30781026/using-a-backslash-in-java