answersLogoWhite

0

Remember that derived classes can access the public and protected members of their base class, but none of the private members. If the member variable in the base class is protected (rather than private), then the derived class can assign it directly. However, this is bad style in OOP as it undermines data-hiding. A protected mutator (set accessor) would be a better option.

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

What value is assigned to extern variable?

Default initial value of extern integral type variable is zero otherwise null.


What are the difference between private variable and final variable?

A private variable is one that is accessible only to the current class and cannot be accessed by any other class, including the ones that extend from it. A final variable is one that cannot be modified once it is initialized and assigned a value.


What is used as placeholder for an assigned value in a computer memory?

Variable


How do you use define in C?

Just type declare then the variable that you desire to assigned a certain constant value on it. Just type declare then the variable that you desire to assigned a certain constant value on it.


What is an expression with one variable?

3x+2 x is a variable. A variable is a symbol (x, y, etc...) that does not have an assigned value.


What is the constant of the variable?

The definition of constant variable is a variable whose value cannot be changed once it has been assigned a value for an experiment. It is the variable held steady, or constant, for a specific experiment.


What Is similar to a variable except it can be assigned a value only once?

A constant.


What is the decimal value of the letter u?

None. A letter has no numerical value unless it represents a variable and a value is assigned to it.


Which is the default variable storage class type in a function?

Everything is an object, and "typed" based on assignation. Your variable will be given a class when you declare it to be something, and the class will depend on what value you give the variable. It is always an object though, and its class may change if you change its value.


What is the current status of the keyword variable in the program?

The current status of the keyword variable in the program is dependent on its declaration and assignment within the code. If the variable has been declared and assigned a value, it is considered to be in use and holds that value until it is changed or the program ends. If the variable has not been declared or assigned a value, it is considered to be uninitialized and may cause errors if used in calculations or operations.


2 plus t7 -1?

And what is the question? - The value of such an expression will depend on the value assigned to the variable, in this case, "t".


What does 2a mean in math?

In mathematics, the expression "2a" represents the product of 2 and the variable "a." This means that you are multiplying the number 2 by the value of the variable "a." The result will depend on the specific value assigned to the variable "a."