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.
少なくとも 3 つの要素を持つ文字列配列があります。3 番目以降のすべての要素を新しい配列にコピーしたいと思います。これを最も効率的に達成するにはどうすればよいでしょうか。
String[] arr = {"One", "Two", "Three", "Four", "Five"}; String[] arr2 = Arrays.copyOfRange(arr, 2, arr.length); //Note third param is exclusive