DESKTOP-O1UAITJ_20200831-史鹏华
一,问题
#### return this 是不是返回的是调用者本身(不太清楚)
public CharacterBuffer append( Object o ) {
String s = String.valueOf( o );
char[] chars = s.toCharArray();
final int n = chars.length ; // 记录被添加的字符个数
int newLength = count + n ;
if( newLength >= buffer.length * 0.9 ) {
int length = Math.max( buffer.length , newLength );
this.ensureCapacity( length * 3 / 2 + 1 );
}
System.arraycopy( chars , 0 , buffer , count , n );
count += n ;
return this ;
}
二,吐槽
#### 这一块学习的方法好多
点赞