The following is basically the three most common method of Java string Type new string () does not describe the basic equivalent of the third
String A; Declares a string type A, which does not have a memory address in the request, nor any point in memory to the reference address;
String a = null; Declare a string of type A, while in memory requested an address, but the address does not point to any reference address;
String a = ""; Declare a string of type A, both in the memory of the application of the address, which also points to a reference to the string reference address;
It is generally best to use string a = "";
You can prevent subsequent programs from being unable to find an exception because of a confusing reference address!
String a = null; String A; Try to use less! No need to use it!
Initialization of the Java string type