If you like to include a quote (") or (') character within the string, then you can use the \ character to indicate that you want to include a special character, and that the next character should be treated differently. \" indicates a quote character, not the termination of a string. You can check this with the following program example. Program ------ public static void main(String[] args) { String strDblQuote = "This is double quote (\"\") "; String strSingleQuote = "This is single quote (\'\') "; System.out.println ("Check this single 'quote' in Java and also "+strSingleQuote); System.out.println ("You can use single \' or double \" quote like this. Also "+strDblQuote); } Output of Above Program ------ Check this single 'quote' in Java and also This is single quote ('') You can use single ' or double " quote like this. Also This is double quote ("")