Answers for "slicing array list java"

1

slice a list java

new ArrayList(input.subList(0, input.size()/2))
Posted by: Guest on February-26-2021
0

slicing array in java

import java.util.Arrays;
public class SlicingAnArray {
   public static void main(String args[]){
      int intArray[] = {12, 14, 58, 225, 56, 96 , 3, 45, 8 };
      intArray = Arrays.copyOfRange(intArray, 3, 7);
      System.out.println(Arrays.toString(intArray));
   }
}
Posted by: Guest on February-21-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language