How do I create an object of an abstract class and interface? I know we can\'t instantiate an object of an abstract class directly.
There are two ways you can achieve this.
1) Either you extend / implement the Abstract class / interface in a new class, create the object of this new class and then use this object as per your need.
2) The Compiler allows you to create anonymous objects of the interfaces in your code.
For eg. ( new Runnable() { ... } );
Hope this helps.
Regards, Mahendra Liya.