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 is advantage of inheritance?
What is overriding vs overloading?
What is abstraction in oops?
Explain the concepts involved in Object Oriented programming.
What is protected in oop?
What is the renewal class?
What does and I oop and sksksk mean?
What is encapsulation example?
what is difference between class template and template class?
#include
What is the oops and benefits of oops programming?
Can an interface inherit a class?
Can a varargs method be overloaded?
What is oops?what is its use in software engineering?
write a code for this. serial_number contained in the header of the file will be read , if this serial number is less than a previous serial number within a successfully processed file, or is the same as another serial number within a successfully processed file, or if the field contains anything other than 7 digits, then the file must error with the reason ‘Invalid SERIAL_NUMBER’.