In Chapter 1, First Programming Steps in Java, we printed a string and the variable. If we look closely, when we print a variable we are not using double quotes, but when we print a string, we are using them. This is because the value is already present in the variable, hence we need not use any double quotes. If we use them, Java considers it to be a string and the output will be printed as the letter a in the following example. If we run this and observe the output, the letter a will be printed as shown in the following screenshot:
If we don't use double quotes, Java will check whether there is any variable defined with this letter. If so, it prints the value present in that variable. If there is no variable defined, then it gives an error. If we comment out the variable...