Give the use of these escape sequence characters in Java in one or two lines with an example each. i) \\ ii) \t iii) \’
Answers
Answered by
1
(i) \\
Used to represent a backslash in a string. This is because a regular backslash is used to indicate escape sequences.
(ii)
Used to represent a horizontal tab space in a string.
(iii)
Used to indicate a single inverted comma in a string (since a character is represented as 'c', representation of inverted comma should be '\'')
Similar questions