I have the following code in which I need to return an object that serializes previously but it still gives me error at the time of casting even when my ArrayList is of Invoice type
public void obtenerF() {
try {
ObjectInputStream entrada = new ObjectInputStream(new
FileInputStream("Factura.obj"));
facturas = (ArrayList<Factura>) entrada.readObject();
entrada.close();
} catch (Exception ex) {
Logger.getLogger(MnuPrincipal.class.getName()).log(Level.SEVERE, null, ex);
}
}