String str = new String("abc");
构造方法说明:java.lang.String.String(String original)
解释:Initializes a newly created String
object so that it represents
the same sequence of characters as the argument; in other words, the newly
created string is a copy of the argument string. Unless an explicit copy of
original
is needed, use of this constructor is unnecessary since
Strings are immutable.
时间: 2024-11-07 17:33:47