Java Java Data Structures Efficiency! Custom Serialization

Anna Poff
Anna Poff
1,560 Points

Crazy error when compiling!

I got this strange error list and wasn't able to get my code to work...

java.io.FileNotFoundException: songs.txt (No such file or directory)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at java.io.FileInputStream.<init>(FileInputStream.java:93)
at com.teamtreehouse.model.SongBook.importFrom(SongBook.java:38)
at Karaoke.main(Karaoke.java:10)
There are 0 songs available and Exception in thread "main" java.util.MissingFormatArgumentException: Format specifier '%d'
at java.util.Formatter.format(Formatter.java:2519)
at java.io.PrintStream.format(PrintStream.java:970)
at java.io.PrintStream.printf(PrintStream.java:871)
at com.teamtreehouse.KaraokeMachine.promptAction(KaraokeMachine.java:36)
at com.teamtreehouse.KaraokeMachine.run(KaraokeMachine.java:53)
at Karaoke.main(Karaoke.java:12)

here's my code: https://w.trhou.se/cx05w8daj6

any help would be much appreciated :)

1 Answer

Manish Giri
Manish Giri
14,726 Points

Line 10 imports from a file called songs.txt, but it doesn't exist in your workspace, as is mentioned in the error - songBook.importFrom("songs.txt");.