Can we have a private constructor ?

Answer Posted / prabha govind

yes
and if a constructor is made private/protected...then that
class cannot be inherited

Is This Answer Correct ?    116 Yes 23 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is abstract class in oop?

720


State what is encapsulation and friend function?

910


What is the diamond problem in inheritance?

789


What is encapsulation in oop?

767


can inline function declare in private part of class?

3937


What is abstract class in oops?

756


What is the types of inheritance?

775


What are two types of polymorphism?

788


Why is polymorphism needed?

773


What are oops methods?

736


What is polymorphism in oops?

718


What are the 4 main oop principles?

916


How to handle exception in c++, For example in a functions i am assigning memory to some variables and also in next instructions in am dividing one variable also. If this functions generates a error while allocating memory to those variable and also while dividing the variable if i divide by zero then catch block how it will identify that this error has cone from perticular instruction

1857


What is class and example?

783


just right the logic of it 1--> If few people are electing then every time ur candidate should win 2--> arrange books in box, if box carry weight == books weight then take another box..... find the no of box required.

6689