Can we have a private constructor ?
Answer Posted / srikanth
We can make a constructor Private or protected.
1. Private constructor is classic example of implementing a
singleton class( A class with a single instance)
2. Protected constructors can be used when the class cannot
be instantiated but can only be inherited.
| Is This Answer Correct ? | 108 Yes | 2 No |
Post New Answer View All Answers
which feature are not hold visual basic of oop?
hi, this is raju,iam studying b.tech 2nd year,iam want know about group1 and group2 details, and we can studying without going to any instutions? please help me.
Why we use classes in oop?
How is polymorphism achieved?
What is encapsulation c#?
What is stream in oop?
What is the point of polymorphism?
What is the importance of oop?
What is ambiguity in inheritance?
What is destructor in oop?
How to use CMutex, CSemaphore in VC++ MFC
Question: Write a program that prints a paycheck. Ask the program user for the name of the employee, the hourly rate, and the number of hours worked. If the number of hours exceeds 40, the employee is paid “time and a half”, that is, 150 percent of the hourly rate on the hours exceeding 40. Be sure to use stepwi se refine ment and break your solution into several functions. Use the int_name function to print the dollar amount of the check.
What is pointer in oop?
What is object in oop?
Why do we use oop?