Print the elements in an array - Java Quiz Question


Write a program to print the elements in an array. Spaces between numbers are important and all the numbers should be in the same line. Use System.out.println or System.out.print for printing.

Input (Integer Array) Printed Output
{2, 3, 4, 7, 6, 1} 2 3 4 7 6 1
{3, 9, 1, 5, 4, 2} 3 9 1 5 4 2



class PrintElementsInArray
{
    public static void main(String s[])
    {
        int input[] = {4, 6, 19, 2, 7, 12, 1, 9};
        printElementsInArray(input);

    }


    public static void printElementsInArray(int[] input)
    {
    }

}