String有两种赋值方式,第一种是通过“字面量”赋值。 String str = "Hello"; 第二种是通过new关键字创建新对象。 String str = new String("Hello");