Player and Dancer

  • 4
  • Locked
On Planet Terra, practically every dancer or player is a human. The same is true in this incomplete program you have in front of you. Take a look at what it does already, and then change the haveFun method so that it calls the play method for players and the dance method for dancers.
You can't complete this task, because you're not signed in.
Comments (4)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Justin Smith
Level 39 , Greenfield, USA, United States
6 August 2021, 20:29
Judging by the help page for this task, you should consider adding this as a condition: "Your solution must use type-casting on the Person object passed in the haveFun method." I say this because many people have used a viable solution of new Player().play() or new Dancer().dance(). This code works for meeting the condition requirements and produces the correct output when run, but fails validation.
Level 22 , Cairns, Australia
16 October 2020, 10:27
hmm, it verified for me but once an "instanceof" either player or dancer occured in "havefun()", havefun() calls either play() or dance() even if the person is neither player nor dancer
27 September 2018, 18:46
Method in problem description doesn't match code. haveFun != takeBreak.
Level 41
28 September 2018, 05:36
Thanks, it will be fixed soon.)