I'm calling the move method doAnotherAction() on the object passed to it, not sure what else to do to get this to pass.
package com.codegym.task.task15.task1520;
/*
Brain training
*/
public class Solution {
public static void main(String[] args) {
Duck duck = new Duck();
Util.fly(duck);
Util.move(duck);
}
public static class Duck implements CanFly, CanMove {
@Override
public void doAction() {
System.out.println("Flying");
}
@Override
public void doAnotherAction() {
System.out.println("Moving");
}
}
public static class Util {
static void fly(Duck animal) {
animal.doAction();
}
static void move(Duck animal) {
animal.doAnotherAction();
}
}
public static interface CanFly {
void doAction();
}
public static interface CanMove {
void doAnotherAction();
}
}