Monday, June 22, 2015

Java–Array fill function

Java–Array fill function

package ArrayMethod;

import java.util.Arrays;

public class fill {

public static void main(String[] args) {
int[] a = { 3, 4, 2, 1 };
System.out.println(Arrays.toString(a));
Arrays.fill(a, 9);
System.out.println(Arrays.toString(a));
}

}

No comments:

Post a Comment