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 / ankur sehgal
public class TrialClass
{
protected int i, j;
public TrialClass(int one, int two)
{
i = one;
j = two;
}
public TrialClass(int joo)
{
}
public int squareArea()
{
int side1;
int side2;
side1 = i;
side2 = j;
return side1 * side2;
}
}
public class myDerivedClass : TrialClass
{
int rd;
int dr;
public myDerivedClass(int Age, int ages):base(Age)
{
rd = ages;
dr = Age;
}
}
Try making the base class single parameterized constructor
private.You will get your answer.
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What makes a language oop?
What does sksksk mean in text slang?
Explain the concepts involved in Object Oriented programming.
Why do we need polymorphism in c#?
Do you know about multiple inheritance?
Is abstract thinking intelligence?
which feature are not hold visual basic of oop?
What is new keyword in oops?
What is the types of inheritance?
What is abstract class in oop?
What is polymorphism and types?
Write a c++ program to display pass and fail for three student using static member function
2. Give the different notations for the class.\
What are functions in oop?
write a code for this:trailer recordId contains a value other than 99, then the file must error with the reason ‘Invalid RECORD_ID’(User Defined Exception).