Hey this is my first post and i have this problem as you can see this the required method enter image description here
so i tried to create an array but an exception is showed so is there any suggestions ?
this my code
public class GArrayFactory {
// Create and return an array of size n
public static <T extends Comparable<T>> GArray<T>[] getGArray(int n) {
GArray<T>[] array = (GArray<T>[]) new Object[n];
return array ;
and this the exception
Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [LGArray;
at GArrayFactory.getGArray(GArrayFactory.java:9)