Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void saveToFile() {
- Collection<Film> filmCollection = database.values();
- for(Film film : filmCollection) {
- try {
- FileWriter outFile = new FileWriter("c:/pmdb/database.txt");
- PrintWriter out = new PrintWriter(outFile);
- out.println(film.toString());
- out.close();
- } catch (IOException e){
- e.printStackTrace();
- }
- }
- }
- //detta ligger i filmklassen
- public String toString() {
- return "Filmen e printad";
- }
Add Comment
Please, Sign In to add comment