Can we have a private constructor ?
Answer Posted / aj
Yes, only if we want to prevent instantiation from other
class, but then the class itself cannot be sub classed.
this the heart of singleton design pattern
Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
What is difference between multiple inheritance and multilevel inheritance?
What does <> mean pseudocode?
What is ambiguity in inheritance?
What is abstraction example?
What is multilevel inheritance explain with example?
What are oops functions?
What is the fundamental idea of oop?
Write A Program to find the ambiguities in Multiple Inheritance? How are they resolved.(Virtual Functions)
Can we define a class within the interface?
What is the importance of oop?
What is object in oops?
What does sksksk mean in text slang?
What do you mean by variable?
What is destructor example?
What is inheritance and how many types of inheritance?