您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

Java-公共字符串(char []值)

Java-公共字符串(char []值)

Java是开放源代码,如果将源代码附加到Eclipse,则始终可以使用F3来检查功能在这种情况下,String类具有以下正在寻找的构造函数

/**
 * Allocates a new {@code String} so that it represents the sequence of
 * characters currently contained in the character array argument. The
 * contents of the character array are copied; subsequent modification of
 * the character array does not affect the newly created string.
 *
 * @param  value
 *         The initial value of the string
 */
public String(char value[]) {
    int size = value.length;
    this.offset = 0;
    this.count = size;
    this.value = Arrays.copyOf(value, size);
}

编辑:如果您想知道,Arrays.copyOf调用System.arraycopy

java 2022/1/1 18:29:39 有389人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶