|
Java Reference Home | Smart Soft Home |
|
|
Single Quotes '
Single quotes have two purposes in Java.
Description 1Used to indicate achar literal.
Examples
System.out.println('S'); //'S' is a char literal
char x = 'H'; //'H' is a char literal
Description 2Used to place quotes inside of quotes for JDBC SQL statements.Example 2
PreparedStatement ps = conn.prepareStatement("SELECT * FROM Companies WHERE CompanyName = 'Sun'");
|
|