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.
Player and Dancer
- 4
Locked
Comments (4)
- Popular
- New
- Old
You must be signed in to leave a comment
Justin Smith
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.
0
MoJo
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
0
Ricardo Olivarria
27 September 2018, 18:46
Method in problem description doesn't match code. haveFun != takeBreak.
0
Roman
28 September 2018, 05:36
Thanks, it will be fixed soon.)
0