Can we have a private constructor ?
Answers were Sorted based on User's Feedback
Answer / namrata ahuja
no. constructors are always declared publicly. they are used
to initialize data members of a class. they are
automatically invoked by a class object declaration so if it
is private it cannot be invoked.
| Is This Answer Correct ? | 6 Yes | 39 No |
Answer / ravi`
no,
we can not make a constructor private , if we make a
constructor private its method cannot access in main method .
| Is This Answer Correct ? | 17 Yes | 136 No |
Can anyone please explain runtime polymorphism with a real time example??at what ciscumstances we go for it??
What is encapsulation?
What is polymorphism in oops?
What is multilevel inheritance explain with example?
write a program in c++ to overload the function add (s1,s2) where s1 and s2 are integers and floating point values.
How oops is better than procedural?
Why we use classes in oop?
What do you mean by overloading?
What is destructor in oop?
what type of questions
What is the diamond problem in inheritance?
write a program using c++ to implement single contiguous memory mangement techniques.display the content of the main memory after yhe allocation of jobs and percentage of the wastage of the main memory