Can we have a private virtual method ?

Answer Posted / nk

We can have virtual functions as long as we dont call the
function from a base pointer pointing to the base
class/derived class.

If we call then gives error.

The same error can be tested by compiling and running above
example.

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write A Program to find the ambiguities in Multiple Inheritance? How are they resolved.(Virtual Functions)

3558


write knight tour problem which is present in datastructure

2168


What are the 4 pillars of oop?

674


String = "C++ is an object oriented programming language.An imp feature of oops is classes and objects".Write a pgm to count the repeated words from this scenario?

1944


What is oops in programming?

570






What is advantage of inheritance?

693


Why is encapsulation used?

579


to find out the minimum of two integer number of two different classes using friend function

1645


What is the difference between inheritance and polymorphism?

594


What is abstraction and encapsulation?

577


What are objects in oop?

612


Why is destructor used?

587


write a program to find 2 power of a 5digit number with out using big int and exponent ?

1899


Following are the class specifications: class {int a}; class {int b}; Using friend funtion,calculate the max of two objects and display it.

2010


can inline function declare in private part of class?

3663