Suppose we have got a class with a certain private member. When I declare a class method and pass an object of the same type, the method is inside, i am able to access all the private members without getters. For example:
class Human{
private int age;
public static int compareAges(Human h1, Human h2){
h1.age // IS CORRECT, DESPITE age is private in h1.
...
}
}
Why is it possible?