I want to splice an array in Java. I tried the method Array.copyOfString to solve the problem. However, the output in the terminal is just two strange strings. Is there anything I can do to fix the functioning of the code?
package exp;
import java.util.Arrays;
public class exp {
public static void main(String[] args){
int[] array={0,1,2,3,4,5,6,7,8,9,10};
int[] a=Arrays.copyOfRange(array, 0, 10);
int[] b=Arrays.copyOfRange(array, 5, 5);
System.out.println(a);
System.out.println(b);
}
}
terminal:
[I@6acbcfc0
[I@5f184fc6
Process finished with exit code 0