Tuesday 8 September 2015

Why an instance can't be created for an abstract class?

An Instance of Abstract class cannot be created because an abstract class may (not compulsory) have some abstract members i.e. members whose declaration is provided and implementation is not and if the instance of this class is created, that abstract method would be invoked and it doesnt have implementation and this would create a problem. To avoid this kind of problem the compiler gives error if we try to create the instance of abstract class (which can also be said as incomplete class)

No comments:

Post a Comment

Note: only a member of this blog may post a comment.