I cannot correctly write the generic method for this:
private int [] loadIntArray(String key, int [] defaultArray) {
    int [] array = new int [4];
    for( int index=0; index<4 ; index++) {
        array[index] = sp.getInt(key + index, defaultArray[index]);
    }
    return array;
}
I wrote this:
private <T[]> loadArray(String key, <T[]> defaultArray) {
    <T[]> array = new <T[LEVELS]>;
    for( int index=0; index<4 ; index++) {
        array[index] = sp.getInt(key + index, defaultArray[index]);
    }
    return array;
}
But it does not compile.
I get several errors, "Return type for method is missing", "Type expected after private token".
What would be the right way to write it?
 
     
     
    