About Question com.enthuware.ets.scjp.v6.2.94 :

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
Juan Andrés Calleja

About Question com.enthuware.ets.scjp.v6.2.94 :

Post by Juan Andrés Calleja »

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.

admin
Site Admin
Posts: 10384
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question com.enthuware.ets.scjp.v6.2.94 :

Post by admin »

You are right. The explanation has been updated accordingly.
thank you for your feedback!

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 6 guests