private members of a class are its sole property and no-one can access it because it's scope is limited to the boundary of the class. Sometimes it is neccessary to preserve certain informations from being accessed outside class for security reasons.. ex: PHI( Protected Health Information) you cannot disclose someone's phi or someone's personal Bank A/C or salary.. these are confidential so keep it private to a class.
private members of a class are its sole property and no-one can access it because it's scope is limited to the boundary of the class. Sometimes it is neccessary to preserve certain informations from being accessed outside class for security reasons.. ex: PHI( Protected Health Information) you cannot disclose someone's phi or someone's personal Bank A/C or salary.. these are confidential so keep it private to a class.
There are few things to note here. Mainly private methods are not inherited. You are invoking the method "someMethod()" (which is private) from within the class which defined the method (you are not able to do that outside this class). "someMethod()" in class B is not the overriden method in class A but a different method which is defined in class B.