提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
复制数组范围
//package com.nowjava; /*来自 nowjava - 时代Java*/ import java.util.Arrays; public class Main { public static void main(String[] argv) throws Exception { String[] arr = new String[] { "1", "abc", "level", null, "nowjava.com", "asdf 123" }; int startIndex = 2; int endIndex = 2; System.out.println(java.util.Arrays.toString(copyArrayRange(arr, startIndex, endIndex))); } public static String[] copyArrayRange(String[] arr, int startIndex,