Q:

How to input array as a parameter in method?

I'm supposed to print a table of array values against their key values. However I receive '.class' expected. But I don't know what is wrong with the code. Please help!
class createTable {
    public static void main (String args []){
        int array[] = {2,13,15,67,87,34,66,23,11,93};
        printTable (array[]);
    }

    static void printTable (int[] array){
        System.out.println ("Key\tValue");
        for (int key = 0; key < array.length; key++){
            System.out.println (key + "\t" + array [key]);
        }
    }
}

A:

Remove the [] from your argument when calling printTable.
printTable (array);

A:

when you write 
int array[] = {...}; 
is the same as writing 
int[] array = {...}
You are telling the JVM that you are creating an object of type int[] (array of int) with reference name array. When you want to pass the array as a method parameter you have to write the reference name between brackets.
class createTable {
    public static void main (String args []){
        int array[] = {2,13,15,67,87,34,66,23,11,93};
        printTable (array);
    }

    static void printTable (int[] array){
        System.out.println ("Key\tValue");
        for (int key = 0; key < array.length; key++){
            System.out.println (key + "\t" + array [key]);
        }
    }
}

