Brain training

  • 4
  • Locked
Find the error in the logic: Duck should correctly implement the CanMove interface. Fix the error so you get the correct result.
You can't complete this task, because you're not signed in.
Comments (2)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Samuel Michael
Level 16 , Stafford, United States
Expert
7 March 2021, 03:51
How are interfaces used to hold values i,e CanFly, CanMove animal?
Aakankasha Sharma
Level 18 , Chandigarh, India
13 March 2021, 18:20
In the function we are accepting a CanFly/CanMove object. Basically what i understand by looking at it is that it is accepting an object that is implementing the CanFly/CanMove blueprint, so basically a parameter for which we can call the resp doAction/doAnotherAction functions. And yeah we can't create objects from interfaces though, Java would throw that error earlier itself.