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
#include
2. Give the different notations for the class.\
What does no cap mean?
Following are the class specifications: class {int a}; class {int b}; Using friend funtion,calculate the max of two objects and display it.
what are the different types of qualifier in java?
Is this job good for future? can do this job post grduate student?
What is abstraction and encapsulation?
What is advantage of inheritance?
Which is not an object oriented programming language?
What is overloading in oops?
hi all..i want to know oops concepts clearly can any1 explain??
What polymorphism means?
What is the difference between a constructor and a destructor?
can inline function declare in private part of class?
What are the important components of cohesion?