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.
No, but a double value can be assigned to a float variable. (You will lose from the precision, obviously.)
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.
Variable
Default initial value of extern integral type variable is zero otherwise null.
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.
3x+2 x is a variable. A variable is a symbol (x, y, etc...) that does not have an assigned value.
A constant.
In C when assigning an integer variable to String variable a compilation error occurs as Incompatible Type Conversion.So that integers cannot get assigned to String variables.
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.
None. A letter has no numerical value unless it represents a variable and a value is assigned to it.
Both increment the value of the variable by one. The difference is the value of the increments expression itself. With preincrement value is taken after incrementing, and with postincrement value is taken before incrementing. Example: Let x have value 5. y = ++x; Both y and x are assigned value 6. Again let x have value 5. y = x++; y is assigned value 5. x is assigned value 6.
it depend on the programming language u use. for instance in c, just decalre the variable and equal it to the value it is to take. eg. my_age=21; /*my_age is the decared variable and 21 is the assigned value*/ //for php $my_age=21; /*my_age is the decared variable and 21 is the assigned value*/ for strings (in php)eg. $my_age="none of ur business" /*$my_age is the variable and the string "none of ur business" is the assigned value*/