Guest User

Untitled

a guest
Jan 12th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. private void saveToFile() {
  2. Collection<Film> filmCollection = database.values();
  3. for(Film film : filmCollection) {
  4. try {
  5. FileWriter outFile = new FileWriter("c:/pmdb/database.txt");
  6. PrintWriter out = new PrintWriter(outFile);
  7. out.println(film.toString());
  8. out.close();
  9. } catch (IOException e){
  10. e.printStackTrace();
  11. }
  12. }
  13. }
  14.  
  15.  
  16. //detta ligger i filmklassen
  17.  
  18. public String toString() {
  19. return "Filmen e printad";
  20. }
Add Comment
Please, Sign In to add comment