1

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("\");
Roman C
  • 49,761
  • 33
  • 66
  • 176

1 Answers1

1

System.out.println("\\");

\ will escape the second \ character.

jongusmoe
  • 676
  • 4
  • 16