public class Test {
public static void main(String[] args) {
int[] a = new int[]{1,2,3,4,5,6};
System.out.println(Arrays.toString(a)); //{1,2,3,4,5,6}
Arrays.fill(a, 0);
System.out.println(Arrays.toString(a)); //{0,0,0,0,0,0}
int[] b = new int[]{1,2,3,4,5,6};
Arrays.fill(b, 2, 4, 0);
System.out.println(Arrays.toString(b)); //{1,2,0,0,5,6}
Boolean[] c = {true,false};
System.out.println(Arrays.toString(c)); //{true,false}
Arrays.fill(c, false);
System.out.println(Arrays.toString(c)); //{false,false}
Arrays.fill(c, 0, 1, true);
System.out.println(Arrays.toString(c)); //{true,false}
String[] d = {"a","b","c","d","e","f"};
System.out.println(Arrays.toString(d)); //{a,b,c,d,e,f}
Arrays.fill(d, 1, 2, "HelloWorld");
System.out.println(Arrays.toString(d)); //{a,HelloWorld,c,d,e,f}
}
}