Estoy empezando y tengo que hacer funcioner el siguiente codigo:
public interface UniversalControl{ public void play(String media); public void stop(); }
public class MobilePhone extends RadioReceiver implements UniversalControl{... public class BluRayPlayer extends DiscPlayer implements UniversalControl{...
MobilePhone objectCel = new MobilePhone(); BluRayPlayer objectDisc = new BluRayPlayer();
poliPlayer = objectDvd; poliPlayer.play("Frozen"); // Print: viewing the Frozen movie poliPlayer = objectCd; PoliPlayer.Play("Frozen"); // Print: listening to the Frozen song
He declarado las clases RadioReceiver y DiscPlayer, pero aun asi no funciona, podrian orientarme, gracias
Estoy empezando y tengo que hacer funcioner el siguiente codigo:
public interface UniversalControl{
public void play(String media);
public void stop();
}
public class MobilePhone extends RadioReceiver implements UniversalControl{...
public class BluRayPlayer extends DiscPlayer implements UniversalControl{...
MobilePhone objectCel = new MobilePhone();
BluRayPlayer objectDisc = new BluRayPlayer();
poliPlayer = objectDvd; poliPlayer.play("Frozen"); // Print: viewing the Frozen movie
poliPlayer = objectCd; PoliPlayer.Play("Frozen"); // Print: listening to the Frozen song
He declarado las clases RadioReceiver y DiscPlayer, pero aun asi no funciona, podrian orientarme, gracias