示例:
package com.github.string.demo1;
/**
* @author maxiaoke.com
* @version 1.0
*/
public class Test {
public static void main(String[] args) {
// 字面量的定义方式
String s1 = "123";
String s2 = "123";
s1 = "hello";
System.out.println("s1 = " + s1); // s1 = hello
System.out.println("s2 = " + s2); // s2 = 123
}
}