publicclassCenterextendsPlayer{@Overridepublicvoidrun(){System.out.println("Center is running.");}@Overridepublicvoidshoot(){System.out.println("Center shoots the ball");}@OverridepublicvoidpassBall(){System.out.println("Center passes ball");}@OverridepublicvoidcatchBall(){System.out.println("Center got the ball");}@Overridepublicvoiddunk(){System.out.println("Center dunk!");}}publicclassPointGuardextendsPlayer{@Overridepublicvoidrun(){System.out.println("PointGuard is running.");}@Overridepublicvoidshoot(){System.out.println("PointGuard shoots the ball");}@OverridepublicvoidpassBall(){System.out.println("PointGuard passes ball");}@OverridepublicvoidcatchBall(){System.out.println("PointGuard got the ball");}@Overridepublicvoiddunk(){System.out.println("PointGuard dunk!");}}publicclassSmallForwardextendsPlayer{@Overridepublicvoidrun(){System.out.println("SmallForward is running.");}@Overridepublicvoidshoot(){System.out.println("SmallForward shoots the ball.");}@OverridepublicvoidpassBall(){System.out.println("SmallForward passes the ball.");}@OverridepublicvoidcatchBall(){System.out.println("SmallForward got the ball.");}@Overridepublicvoiddunk(){System.out.println("SmallForward dunk.");}}
InsideCommand:
PointGuard got the ball
Center is running.
PointGuard passes ball
Center got the ball
Center dunk!
------------------------------
ThreePointCommand:
Center passes ball
PointGuard got the ball
SmallForward is running.
PointGuard passes ball
SmallForward got the ball.
PointGuard is running.
SmallForward passes the ball.
PointGuard got the ball
PointGuard shoots the ball