How to create a sub array from another array in Java?

前端 未结 9 547
醉话见心
醉话见心 2020-11-29 16:02

How to create a sub-array from another array? Is there a method that takes the indexes from the first array such as:

methodName(object array, int start, int          


        
9条回答
  •  情书的邮戳
    2020-11-29 16:48

    Arrays.copyOfRange(..) was added in Java 1.6. So perhaps you don't have the latest version. If it's not possible to upgrade, look at System.arraycopy(..)

提交回复
热议问题