/*
	The program demonstrates how a reference to an array
	Can be returned from a method and uses the array
	
*
*/

import java.util.*;

public class ArrayReturn
{
	static Scanner key = new Scanner(System.in);
	
	public static void main(String[] args)
	{
		int[] showNum;
		
		// Gets the size of the array
		
		System.out.println("How many numbers would you like to enter?");
		int size = key.nextInt();
		
		// Assign the array returned by the getNumber method to the array variable values
		
		showNum = getNumber(size);
		
		// Outputs the array
		
		System.out.println("The number you entered are: ");
		for(int i=0; i<showNum.length; i++)
		{
			System.out.println(showNum[i]);
		}
		
	}
	
	// Gets the values from the user, then returns the array
	
	public static int[] getNumber(int size)
	{
		
		int[] getNum = new int[size];
		
		System.out.println("Please!! enter your numbers: ");
		
		for(int i=0; i<getNum.length; i++)
		{
			getNum[i] = key.nextInt();
		}
		
		return getNum;
	}
}