Can we instantiate abstract class?

Monaj Singh

Total Post:41

Points:287

Posted by  Monaj Singh
 1268  View(s)
Ratings:
Rate this:
abstract class my {
    public void mymethod() {
        System.out.print("Abstract");
    }
}
class poly {
    public static void main(String a[]) {
        my m = new my() {};
        m.mymethod();
    }
}
Here, I'm creating instance of my class and calling method of abstract class. Can anyone please explain this to me? 

Answer

Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.