Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个至少包含三个元素的字符串数组。我想将第三个和所有后续元素复制到一个新数组中。如何最有效地实现这一目标?
String[] arr = {"One", "Two", "Three", "Four", "Five"}; String[] arr2 = Arrays.copyOfRange(arr, 2, arr.length); //Note third param is exclusive