Java Java Data Structures Efficiency! Menu UI

Why did we pass songBook in KaraokeMachine object?

Why

KaraokeMachine machine = new KaraokeMachine(songBook);

Why songBook as parameter?

Tonnie Fanadez Jennifer Nordell andren

1 Answer

Simon Sporrong
Simon Sporrong
31,912 Points

Probably because the KaraokeMachine constructor takes a SongBook as a parameter. You can see it on line 18 in the video at 03:51 in the video.

So in order to instantiate a KaraokeMachine object you need to pass it a SongBook. What good is a karaoke machine without songs to sing in it? :)

Hope it helps!

Got it thanks