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


Please Help Members By Posting Answers For Below Questions

What makes a language oop?

598


What does sksksk mean in text slang?

1537


Explain the concepts involved in Object Oriented programming.

642


Why do we need polymorphism in c#?

689


Do you know about multiple inheritance?

642






Is abstract thinking intelligence?

598


which feature are not hold visual basic of oop?

1725


What is new keyword in oops?

593


What is the types of inheritance?

604


What is abstract class in oop?

536


What is polymorphism and types?

602


Write a c++ program to display pass and fail for three student using static member function

2818


2. Give the different notations for the class.\

1594


What are functions in oop?

586


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).

1645