Post date: Nov 8, 2014 6:48:37 PM
Starter
Polymorphism
Abstract Class
1. Extending the Abstract class:
class ConcreteClass extends AbstractClass {} AbstractClass c = new ConcreteClass();
2. Using Anonymous Class: To store the object/instance of anonymous inner Subclass of AbstractClass
AbstractClass c = new AbstractClass(){};
EDIT: You can of course not reuse the anonymous inner class, since it is anonymous and implicitly final, and the only place where an instance of it can be created is right here.
Abstract Method