class Player
{
void play()
{
System.out.println("Start the game");
}
void pause()
{
System.out.println("stop the game for rest 5 min.");
}
void stop()
{
System.out.println("finish the game");
}
}
class GenericPlayer extends Player
{
void play()
{
System.out.println("Start the game for GenericPlayer");
}
void pause()
{
System.out.println("resume the game for GenericPlayer");
}
void stop()
{
System.out.println("end the game for GenericPlayer");
}
}
class DvdPlayer extends GenericPlayer
{
void play()
{
System.out.println("Start the game for dvdPlayer");
}
void pause()
{
System.out.println("resume the game for dvdPlayer");
}
void stop()
{
System.out.println("end the game for dvdPlayer");
}
public static void main(String args[])
{
DvdPlayer ab=new DvdPlayer();
ab.play();
ab.pause();
ab.stop();
}
}
No comments:
Post a Comment