1.

Which Should Be More Useful: The Protected And Public Virtuals?

Answer»

PUBLIC virtuals are more preferable than protected virtuals. Public virtuals permit a PROGRAM to directly modify the values of data members. It can be accessible to any function that is within the scope of the structure. It translates the IMPLEMENTATION for the user of the class. It is the most common, convenient, and easiest way to implement by any of the programs.
On the other hand, protected virtual functions are USED for hiding some methods or data members from the OUTSIDE class making it consistent and symmetrical in its approach. It is condition specific, so not commonly used.

Public virtuals are more preferable than protected virtuals. Public virtuals permit a program to directly modify the values of data members. It can be accessible to any function that is within the scope of the structure. It translates the implementation for the user of the class. It is the most common, convenient, and easiest way to implement by any of the programs.
On the other hand, protected virtual functions are used for hiding some methods or data members from the outside class making it consistent and symmetrical in its approach. It is condition specific, so not commonly used.



Discussion

No Comment Found