这个字符串构造函数的实现如何工作(java)?

use*_*534 3 java string constructor field private

 public String(String original) {
     int size = original.count;
     char[] originalValue = original.value;
     char[] v;
     if (originalValue.length > size) {
         // The array representing the String is bigger than the new
         // String itself.  Perhaps this constructor is being called
         // in order to trim the baggage, so make a copy of the array.
         int off = original.offset;
         v = Arrays.copyOfRange(originalValue, off, off+size);
     } else {
         // The array representing the String is the same
         // size as the String, so no point in making a copy.
         v = originalValue;
     }
     this.offset = 0;
     this.count = size;
    this.value = v;
 }
Run Code Online (Sandbox Code Playgroud)

我很抱歉,如果我是愚蠢的,但我不明白.计数和值字段是私有的,但此代码似乎以某种方式直接达到这些值.怎么会这样?

Oli*_*rth 5

private 表示"只能由类访问",而不是"只能由对象访问".