We would like to know how to fill array values.
import java.util.Arrays; /* w ww .j a v a 2s . co m*/ public class Main { public static void main(String[] args) { int[] integer = new int[10]; System.out.println(Arrays.toString(integer)); Arrays.fill(integer, 1, 4, 5); System.out.println(Arrays.toString(integer)); } }
The code above generates the following result.