abstract class A
{
abstract void callme();
}
class B extends A
{
void callme()
{
System.out.println("this is callme.");
}
public static void main(String[] args)
{
B b=new B();
b.callme();
}
}
// if this can be done through overriding why use abstraction
class Animal
{
Animal myType()
{
return new Animal();
}
}
class Dog extends Animal
{
Dog myType() //Legal override after Java5 onward
{
return new Dog();
}
}