String,StringBuilder,StringBuffer三者的区别,发现自己确实对这方面的知识不是很了解.所以学习了一下做个笔记.
String
- String 类是一个常量,String类本身和其中存储字符的数组都是用final关键字修饰的,所以不能被继承
/** The value is used for character storage. */
private final char value[];
String str="hello world"和String str=new String(“hello world”)的区别
public class Main {
public static void main(String[] args) {
String string1 = "hello word";
String string2 = new String("hello world");
String string3