1, the single quotation marks the data is a char type, double quotation marks the data is a string type, single quotation marks can only one character, and double quotation marks may be cited 0 and above. Char is just a basic type, and string can be a class that can be referenced directly.
such as Char c= ' C '; The method cannot be called directly on C.
String s= "ABC"; You can call S.charat (0), and so on, because string is the class, and that is the object's call.
2. Single quotes in SQL statements can identify text-type data. are bounded characters that identify the beginning and end of their reference data. In addition, SQL in Java uses single quotes to define the variables that are introduced:
String sql = "SELECT * * * * * FROM where * * = ' " + variable + " '";
3, in the following SQL statement (SQL Server) appears to have the single quotation mark in double quotation marks is the suspicion that the ' Chstr.chstr (G.getgoodsname ()) ' into the whole, by the way each value is "," separated
String sql = "Insert into Tb_goods (Typeid,goodsname,introduce,price,nowprice,picture,newgoods,sale) VALUES ( " +
G.gettypeid () + ",'" + chstr.chstr (G.getgoodsname ()) + "', '" +//Call Chstr object when calling Chstr method with: ' Chstr.chstr ( G.getgoodsname ()) '
Chstr.chstr (G.getintroduce ()) + "'," + g.getprice () + "," +
G.getprice () + ", '" + Chstr.chstr (G.getpicture ()) + "'," +
G.getnewgoods () + "," + g.getsale () + ")";
Single and double quotation marks in Java