Here is where the code is throwing the error:
public class ArrayPila<E extends Bebidas> implements Pila<E>{
private static final int TAMAÑO=5;
private E []arP;
private int tope;
public ArrayPila() {
arP=(E[]) new Object[TAMAÑO];
tope=-1;
}
}
I'm just creating a generic stack with a type of object (created in another class) and it gives me:
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Lmis.java.clases.Bebidas;
at mis.java.estructuras_de_apoyo.ArrayPila.<init>(ArrayPila.java:13)
at mis.java.miformulario.VentanaP.<init>(VentanaP.java:67).
Could you please help?