When a private constructer is being inherited from one
class to another class and when the object is instantiated
is the space reserved for this private variable in the
memory??
Answer Posted / sillu nu oru c coder
When a constructor is made private, object of that class
can not be created. That is called as Abstract class.
constructors can not be inherited. Moreover, when this
class is inherited, the base class object can not be
created. So we can not create the derived class object
also.
the above ans is irrelevant to the current situation,
here the thing is, a constructor cannot b private coz there
is no use of .
but if a situation occurs as such in the given prob, yes the
space is reserved for that useless private constructor.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Can we have inheritance without polymorphism?
What is destructor example?
What is encapsulation in oops?
Why do we use oop?
Why do we use class?
How do you define a class in oop?
write a program that takes input in digits and display the result in words from 1 to 1000
Can we define a class within the interface?
Question: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date.
What is object in oop?
What is abstraction oop?
What is Difference Between Inheritance and creating object and getting data? means Class A extends B{ B.getMethod();} (OR) Class A{ b obj=new B(); obj.getMethod(); }
what are the realtime excercises in C++?
What is inheritance and how many types of inheritance?
What is class and object in oops?