\
is used as for escape sequence in many programming languages, including Java.
If you want to
- go to next line then use
\n
or\r
, - for tab use
\t
- likewise to print a
\
or"
which are special in string literal you have to escape it with another\
which gives us\\
and\"
More Related Contents:
- Difference between string object and string literal [duplicate]
- How to approach this hackerrank puzzle?
- how to do substring of HttpResponse in android
- Write String with preceding zeros into CSV file in java
- How do I create a Java string from the contents of a file?
- How to nicely format floating numbers to string without unnecessary decimal 0’s
- String is immutable. What exactly is the meaning? [duplicate]
- Why can’t strings be mutable in Java and .NET?
- Remove all occurrences of char from string
- Java – Convert integer to string [duplicate]
- String concatenation in Java – when to use +, StringBuilder and concat [duplicate]
- In Java, is there a way to write a string literal without having to escape quotes?
- ArrayList initial capacity and IndexOutOfBoundsException [duplicate]
- CharSequence VS String in Java?
- Java String – See if a string contains only numbers and not letters
- Converting String to “Character” array in Java
- How can I remove a substring from a given String?
- How to insert Space after every Character of an existing String in Java?
- How do I check if a char is a vowel?
- Find the Number of Occurrences of a Substring in a String
- What is a good 64bit hash function in Java for textual strings?
- Reliably convert any object to String and then back again
- How to implement a SQL like ‘LIKE’ operator in java?
- Query String Manipulation in Java
- Java generating Strings with placeholders
- How can I remove punctuation from input text in Java?
- How to determine if a String contains invalid encoded characters
- How do I copy a stack in Java?
- How can I unescape HTML character entities in Java?
- How do I get the first n characters of a string without checking the size or going out of bounds?