import java.util.*; import java.io.*; public class DataforbindelseFil extends Dataforbindelse { private List alle; private void gem() { try { ObjectOutputStream p = new ObjectOutputStream( new FileOutputStream("data.ser")); p.writeObject(alle); p.close(); } catch (Exception e) { e.printStackTrace(); } } public DataforbindelseFil() { try { ObjectInputStream p = new ObjectInputStream( new FileInputStream("data.ser")); alle = (List) p.readObject(); p.close(); } catch (Exception e) { alle = new ArrayList(); } } public void sletAlleData() { alle = new ArrayList(); gem(); } public void indsæt(Kunde k) { alle.add(k); gem(); } public List hentAlle() { return alle; } }