/** String is an unchangeable class. Once created, the character sequence contained in the object is unchangeable * the content of a string object cannot be changed, once the content variable is changed to a new String object, * string constants and basic type constants are stored in an independent constant pool of JVM * string uses private final char value []. implement storage */public class stingdemo {public static void main (string [] ARGs) {string S1 = "hello"; string S2 = "hello"; // S1, S2 points to the same region in the constant pool system. out. println (S1 = S2); // true // The equals () method compares the content system. out. println (s1.equals (S2); // truesystem. out. println ("========================"); string S3 = new string ("well "); string S4 = new string ("well"); // S3, S4 points to different addresses in the heap, but its content is located in the same region of the constant pool system. out. println (S3 = S4); // falsesystem. out. println (s3.equals (S4); // true }}