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

前端 未结 9 551
醉话见心
醉话见心 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:29

    Using Apache ArrayUtils downloadable at this link you can easy use the method

    subarray(boolean[] array, int startIndexInclusive, int endIndexExclusive) 
    

    "boolean" is only an example, there are methods for all primitives java types

提交回复
热议问题