-
Notifications
You must be signed in to change notification settings - Fork 46.1k
关于ArrayList中的Arrays.copy()中的建议 #1193
Copy link
Copy link
Closed
Labels
enhancementNew feature or request or suggestionNew feature or request or suggestion
Description
建议可以把Arrays.copy()和System.arraycopy()的源码附上去
是关于ArrayList的文章入口
Arrays.copyOf()
public static int[] copyOf(int[] original, int newLength) {
//newLength 要返回的副本的长度
int[] copy = new int[newLength];
System.arraycopy(original, 0, copy, 0,
Math.min(original.length, newLength));
return copy;
}
System.arraycopy()
public static native void arraycopy(Object src, int srcPos,
Object dest, int destPos,
int length);
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request or suggestionNew feature or request or suggestion