Private variable accessibility

Private variable Accessibility Java Private access specifier

Private access specifier and Private variable requires more elaborate discussion as many people are not aware of its in and outs. private variables and methods of a class can be accessed within the same class only. By inheritance, even subclasses cannot use by composition. Maximum extent other classes should call…