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
Is oop better than procedural?
write string class as your own class in java without using any built-in function
Why do pointers exist?
When not to use object oriented programming?
What are the two different types of polymorphism?
Why do we use class?
Why is oop better than procedural?
design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)
What is the difference between a constructor and a destructor?
What is overriding vs overloading?
Write a c++ program to display pass and fail for three student using static member function
What is the highest level of cohesion?
What is a superclass in oop?
when to use 'mutable' keyword and when to use 'const cast' in c++
What is abstract class in oops?