class Creature
{
void eating()
{
System.out.println("Eating...");
}
}
//extends the properties of superclass Creature
class Cat extends Creature
{
void walking()
{
System.out.println("Walking...");
}
}
//extends the properties of superclass Creature
class crow extends Creature
{
void flying()
{
System.out.println("Flying...");
}
}
public class Main
{
public static void main(String args[])
{
Cat c = new Cat();
crow c2 = new crow();
// Accessing method of superclass with instance of subclass
c.eating();
c.walking();
c2.eating();
c2.flying();
}
}