nei catch devi mettere un return di un oggetto, credo null ma scegli tucodice:ObjectInputStream in = null; try { in = new ObjectInputStream(new FileInputStream("restore.dat")); ArchivioBancoPosta A = (ArchivioBancoPosta)in.readObject(); ContoBancoPosta.ProgressivoConto=A.ProgressivoConto; return A; } catch (ClassNotFoundException cnfex) { cnfex.printStackTrace(); } catch (IOException ioex) { ioex.printStackTrace(); JOptionPane.showMessageDialog(null,"Caricamento dati non riuscito"); } finally { if (in != null) in.close(); }