Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
为什么在java中定义String时,作为一个类,我们不使用new关键字?
我们将其用作:
String a="Hello";
Java中的类定义为:
Class1 obj = new Class1;
字符串常量会自动转换为字符串对象。