import java.util.Scanner; import java.lang.Math; public class Arrays { static Scanner keyboard = new Scanner(System.in); public static void main(String[] args) { int[] testArray = new int[10]; fillFromKeyboard(testArray); } // Fills the array toFill with random ints between 0 and 9 public static void fillRandom(int[] toFill) { for(int i = 0; i < toFill.length; i++) { toFill[i] = (int)(Math.random() * 10); } } // Fills the array toFill with ints read from the keyboard public static void fillFromKeyboard(int[] toFill) { for(int i = 0; i < toFill.length; i++) { System.out.println("Next number: "); toFill[i] = keyboard.nextInt(); } } }