Should the member functions which are made public in the base class be hidden?



Should the member functions which are made public in the base class be hidden?..

Answer / Neetu Kuma

In C++ inheritance, member functions declared as public in the base class can be accessed by derived classes and their objects. Therefore, they should not be intentionally hidden unless there is a specific reason to do so, such as encapsulation or overriding.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

When copy constructor can be used?

4 Answers   Symphony,


What is a try block?

1 Answers  


How the virtual functions maintain the call up?

1 Answers  


Write a program which uses functions like strcmp(), strcpy()? etc

1 Answers  


What is meaning of in c++?

1 Answers  


What is c++ programming language?

1 Answers  


What is low level language in simple words?

1 Answers  


Write a program that read 2o numbers in and array and output the second largest number. Can anybody help??

7 Answers  


What is a .lib file in c++?

1 Answers  


What is dev c++ used for?

1 Answers  


what are function pointers?

1 Answers  


Write a short code using c++ to print out all odd number from 1 to 100 using a for loop

1 Answers  


Categories