Character and String Literals

They contain Unicode (UTF-16) characters. For $\lstinline{char}$ literals, single quotations are used. For example, $'a', '\symbol{92}u0111'$ etc. For $\lstinline{String}$ literals, double quotation is used. For example, programming, Java 8. Java also supports a few special escape sequences. For example, $\symbol{92}b$ (backspace), $\symbol{92}t$ (tab), $\symbol{92}n$ (line feed), $\symbol{92}f$ (form feed), $\symbol{92}r$ (carriage return), $\symbol{92}''$ (double quote), $\symbol{92}'$ (single quote), and $\symbol{92}\symbol{92}$ (backslash).


\begin{lstlisting}
class DoubleExample {
public static void main(String[] args)...
...ystem.out.println(newLine);
System.out.println(myString);
}
}
\end{lstlisting}