Thanks Abhimaran for the explanation. So, Private members are private to the class and not the specific objects.
This is one way using which objects of same class can access private members of each other.
After this, I wrote some
test codes for checking protected access modifier.
Protected members can be directly accessed through objects of Base class from the derived classes within the same package.
But it doesn't work with subclasses in different package, where one needs to use Derived class object to access base class protected members.