Implement interfaces Eat, Fly, Sleep.
Implement class Bird that implements interfaces Eat, Fly, Sleep.
interface Fly {
void fly();
}
interface Eat {
void eat();
}
interface Sleep {
void sleep();
}
class Bird implements Fly, Eat, Sleep {
public void fly() {
// Flight implementation
}
public void eat() {
// Eating implementation
}
public void sleep() {
// Sleep implementation
}
}Each line contains one of the bird's action: fly, eat or sleep.
For each bird's action print in a separate line the corresponding output.
Example 1