This may not be exactly what you need, but this can give you a starting place: www.tutorialhero.com package com.yahoo.answers; import java.util.Scanner; public class EnterIntegers { public static void main(String[] args) { // create a Scanner object to get input from the user Scanner scan = new Scanner(System.in); // ask the user how many values are in the array System.out.println("How many
. numbers do you want to enter?"); int n = scan.nextInt(); // create an array big enough to hold the numbers int[] numbers = new int[n]; // ask the user for the numbers. An exception will be thrown if a non-numeric for (int i = 0; i < n; i++) {System.out.println("Enter the next number> ");int number = scan.nextInt();numbers[i] = number;}// show the numbers that were entered for (int i = 0; i < n; i++) {System.out.print(numbers[i] + " ");}System.out.println();} }