Last active
June 5, 2019 14:17
-
-
Save dnivra26/27b2f5765bdb8c8a4d01d5655e98095f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BookDB { | |
public void save(Book book) { | |
try { | |
FileWriter fw = new FileWriter("books.txt"); | |
fw.write(book.getTitle() + "-" + book.getAuthor()); | |
fw.close(); | |
} catch (Exception e) { | |
System.out.println(e); | |
} | |
System.out.println("Success..."); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment