Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. public Banco (String nombreFichero)throws IOException,ClassNotFoundException {
  2. ObjectInputStream entrada;
  3. boolean res = true;
  4. entrada = new ObjectInputStream(new FileInputStream (nombreFichero));
  5. aCuentas = new ArrayList <Cuenta>() ;
  6. try{
  7.  
  8. while(res!=false){
  9. aCuentas.add((Cuenta)entrada.readObject());
  10. }
  11. }
  12. catch(IOException e){res=false;}
  13. catch(ClassNotFoundException a){res=false;}
  14. finally { entrada.close();}
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement