Hello, in the fifth option
class MidiPlayer implements MusicPlayer<Instrument> {
public void play(Guitar g){ }
}
the explanation says:
"Since MusicPlayer is typed to Instrument here, MidiPlayer must have a method play(Instrument)"
Is true that MusicPlayer is typed to Intrument, but in the exercise, MusicPlayer interface extends Player interface in RAW mode (without using generics).
interface MusicPlayer<E extends Instrument> extends Player{ }
So in practice i think that the correct explanations should be this:
"Since MusicPlayer is typed to Instrument here, MidiPlayer must have a method play(Object)"
So, but if you really wish maintain the explanation that exercise show, the interface Music Player should be fixed like this:
interface MusicPlayer<E extends Instrument> extends Player<E>{ }
The explanation in this case would be correct.
I hope I have explained correctly.
About Question com.enthuware.ets.scjp.v6.2.94 :
Moderators: Site Manager, fjwalraven
-
- Site Admin
- Posts: 10384
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question com.enthuware.ets.scjp.v6.2.94 :
You are right. The explanation has been updated accordingly.
thank you for your feedback!
thank you for your feedback!
Who is online
Users browsing this forum: Google [Bot] and 6 guests