oop - Can we create a abstract class without using abstract keyword? -


this question asked interviewer in 1 of interviews.

we can avoid creating instance of class using private constructor cannot inherit class

thanks in advanve

well can use private constructor, not make class abstract.

it means other classes cannot create new instance of class.

but class can still call own constructor through static method, therefore creating new instance of itself.

if don't want class instanciated @ all, never ever, use abstract keyword...


Comments

Popular posts from this blog

How to get the arclen between two curve points in Maya? -

C++ Linked List -

git svn - Unignore directories in git-svn (adding directories to a sparse checkout) -