Arrays class in Java
import java.util.Arrays; class Test { public static void main(String[] args) { String[] names = {“John”, “Steve”, “Melissa”, “Maria”}; System.out.println(Arrays.toString(names)); } } Output: [John, Steve, Melissa, Maria] copyOf(type [] a, int n) Returns a new copy of the array, which consists of the first n of its elements. import java.util.Arrays; class Test { public static…
Read More Arrays class in Java