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
What type of loop is a for loop?
Can destructor be overloaded?
They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?
Write a program to compute for numeric grades for a course. The course records are in a file that will serve as the input file. The input file is in exactly the following format: Each line contains a student's first name, then one space, then ten quiz scores all on one line. The quiz scores are in whole number and are separated by one space. Your program will take it input from this file and sends it output to a second file. The data in the output file will be exactly the same as the data in the input file except that there will be one additional number (of type double) at the end of each line. This number will be the average of the student's ten quiz scores. Use at least one function that has file streams as all or some of its arguments.
Is data hiding and abstraction same?
Is enum a class?
What is Difference Between Inheritance and creating object and getting data? means Class A extends B{ B.getMethod();} (OR) Class A{ b obj=new B(); obj.getMethod(); }
What is polymorphism programming?
What is encapsulation oop?
What is static modifier?
What is polymorphism give a real life example?
How to use CMutex, CSemaphore in VC++ MFC
what are the different types of qualifier in java?
What is abstraction example?
What is encapsulation with example?