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

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

    The code is correct so I'm guessing that you are using an older JDK. The javadoc for that method says it has been there since 1.6. At the command line type:

    java -version
    

    I'm guessing that you are not running 1.6

提交回复
热议问题