What is the difference between public, private, protected
inheritance?

Answers were Sorted based on User's Feedback



What is the difference between public, private, protected inheritance?..

Answer / adit

# 3

for V.M public
class a class b
private =! private.
public = public.
protected = public.

for V.M private
class a claas b
private =! private.
public = private.
protected = private.

for V.M protected
class a class b
private =! private.
public = protected.
protected = protected.

(Where V.M= Virtuality Mode)

Is This Answer Correct ?    17 Yes 29 No

What is the difference between public, private, protected inheritance?..

Answer / mahen dimri

for V.M public
class a class b
private =! private.
public = public.
protected = protected.

for V.M private
class a claas b
private =! private.
public = private.
protected = private.

for V.M protected
class a class b
private =! private.
public = protected.
protected = protected.

(Where V.M= Virtuality Mode)

Is This Answer Correct ?    23 Yes 41 No

Post New Answer

More C++ General Interview Questions

How do you flush a buffer in c++?

0 Answers  


which one is equivalent to multiplying by 2:Left shifting a number by 1 or Left shifting an unsigned int or char by 1?

0 Answers  


If a round rectangle has straight edges and rounded corners, your roundrect class inherits both from rectangle and from circle, and they in turn both inherit from shape, how many shapes are created when you create a roundrect?

0 Answers  


template<class T, class X> class Obj { T my_t; X my_x; public: Obj(T t, X x) : my_t(t), my_x(x) { } }; Referring to the sample code above, which one of the following is a valid conversion operator for the type T? a) T operator T () { return my_t; } b) T operator(T) const { return my_t; } c) operator(T) { return my_t; } d) T operator T (const Obj &obj) { return obj.my_t; } e) operator T () const { return my_t; }

1 Answers   Quark,


What is the use of default constructor?

0 Answers  


What is ios class in c++?

0 Answers  


What is the rule of three?

0 Answers  


What is iostream in c++ used for?

0 Answers  


What is the difference between equal to (==) and assignment operator (=)?

0 Answers  


What are exceptions c++?

0 Answers  


Is c++ an oop?

0 Answers  


what are the iterator and generic algorithms.

0 Answers  


Categories