class Tree
{
public void myName()
{
System.out.println("I ame tree");
}
}
class appleTree extends Tree
{
public void myName()
{
System.out.println("I am apple tree");
}
}
class pearTree extends Tree
{
public void myName()
{
System.out.println("I am pear tree");
}
}
class program
{
public static void main(String [ ] args)
{
Tree a = new appleTree();
Tree p = new pearTree();
a.myName();
p.myName();
}
}