A variable defined local in a class cannot be seen/accessed by sub-classes ,while the variable declared as 'protected' can be inherited by the sub-classes.
We use protected keyword for declaring the main_t method of the driver ,as the sub-classes may modify it but this method encapsulates the main functionality of the driver an hence must not be tampered with from other classes.
Similarly a variable such as parity or a switch which determines the data length or interpacket size,must not be tampered and yet can be modified by sub-classes.
On a similar note what properties/methods must be declared local.Can i get some examples?
Regards, Pooja Vaishnav |