javastringstring-literals

What is the backslash character (\\)?


What is the string literal \\ backslash? What does it do? I have thought about it but I do not understand it. I also read it on wikipedia. When I try to print the following:

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

the output is: Mango \ Nightangle

What is the significance of this string literal?


Solution

  • \ is used as for escape sequence in many programming languages, including Java.

    If you want to