I have a class Creature with another class Flying and Undead that extends Creature. How could I create a object that have both the Flying and Undead attributes?
class Creature(){
String name;
public Creature(String name){
this.name=name;
}
class Flying extends Creature{
...
}
class Undead extends Creature{
...
}
Object creature = new Object();//Both Flying and Undead
Is there another way to do it or should I use a different approach?