Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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??

Answers were Sorted based on User's Feedback



When a private constructer is being inherited from one class to another class and when the object ..

Answer / uttama

constructors can not be inherited!
bcoz their work is to initialise the object of the class to
which they belong to!
so if they get inherited,how can they initialise the object
of the derived class!

Is This Answer Correct ?    17 Yes 0 No

When a private constructer is being inherited from one class to another class and when the object ..

Answer / kamlesh

How do u expect a private part of a class to be inheritable
Do u have any code to support your views
I am ready to solve the same

Is This Answer Correct ?    10 Yes 0 No

When a private constructer is being inherited from one class to another class and when the object ..

Answer / karandeep malik

The question is very absurd. From where did we get the
variable stuff? And ya, how on earth do we get private
members/functions being inherited? Kamlesh is right in
saying that The whole idea stinks.

Is This Answer Correct ?    8 Yes 1 No

When a private constructer is being inherited from one class to another class and when the object ..

Answer / balakishore

before invoking derived class constructor base-class
constructor should be called.
1. first base-class object will be created then derived-
class object will be created.
2. here the base class constructor is private, so derived-
class cannot invoke it.

No object is created in derived-class.

Is This Answer Correct ?    7 Yes 0 No

When a private constructer is being inherited from one class to another class and when the object ..

Answer / sanjay makwana, puna

Private Constructor is not inherited.
When private member varible is not inherited but the size is
occupid in dervied class object.

e.g.
#include <iostream.h>
class A
{
int x;
int y;
};

class B : private A
{
};

int main()
{
cout << sizeof(B);
}

output :
8

Is This Answer Correct ?    3 Yes 0 No

When a private constructer is being inherited from one class to another class and when the object ..

Answer / 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

When a private constructer is being inherited from one class to another class and when the object ..

Answer / reejusri

Neha, your question is not proper, please edit that. Some
where inheritance of private constructor and some where
private variable.
Please edit it so that people can help you.

Is This Answer Correct ?    1 Yes 0 No

When a private constructer is being inherited from one class to another class and when the object ..

Answer / 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

When a private constructer is being inherited from one class to another class and when the object ..

Answer / antu

how full this qiestion is????????

are you made???????????????

Is This Answer Correct ?    1 Yes 2 No

When a private constructer is being inherited from one class to another class and when the object ..

Answer / veena

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.

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More OOPS Interview Questions

program in c++ that can either 2 integers or 2 floating point numbers and output the smallest number

1 Answers   Anna University,


polymorphism means?

6 Answers   BFL,


What is Inheritance, Multiple Inheritance, Shared and Repeatable Inheritance?

4 Answers   Accenture, L&T,


What is constructor in oop?

0 Answers  


How to execute business logic for only once ..?even though user clicks submit button multiple times by mistake..? (i disabled JavaScript)

1 Answers  


What is overriding in oops?

0 Answers  


In multilevel inheritance constructors will be executed from the .... class to ... class

2 Answers   ABCO, TCS,


We have a scale and 7 balls. 1 ball is heavier than all the rest. How to determine the heaviest ball with only 3 possible weighing attempts?

8 Answers   IBM, Sage, Vertex,


c++ is a purely oop concept?

3 Answers   Google, TCS,


can you give the dynamic polymorphism types?

2 Answers   Wipro,


What type of loop is a for loop?

0 Answers  


what is mean by design pattern

4 Answers  


Categories