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?
\
is used as for escape sequence in many programming languages, including Java.
If you want to
\n
or \r
, \t
\
or "
which are special in string literal you have to escape it with another \
which gives us \\
and \"