1.

Instance of which type of class can’t be created?(a) Anonymous class(b) Nested class(c) Parent class(d) Abstract classI got this question in an interview for internship.My doubt stems from Classes topic in section OOPs Concept & Features of Object Oriented Programming

Answer»

Correct choice is (d) Abstract class

Easy explanation - INSTANCE of abstract class can’t be CREATED as it will not have any constructor of its own, hence while CREATING an instance of class, it can’t initialize the object members. Actually the class INHERITING the abstract class can have its instance because it will have implementation of all members.



Discussion

No Comment Found

Related InterviewSolutions