Java examples for Language Basics:Array
For example, here's a routine that creates an array of integers and initializes each element to 100:
import java.util.Arrays; public class Main { public static void main(String[] args) { int[] ran = new int[10]; Arrays.fill(ran, 10);/*from w ww . j a v a2 s. c o m*/ System.out.println(Arrays.toString(ran)); } }