You seem to have just said the same thing I said, in different words.
So I really do not understand your "doubt."
The point is, when you code
Code:
public static int getAge(Practice prac)
{
return prac.age;
}
the member
age that you are getting there is *NOT* the CLASS variable named
age. It is the OBJECT member that is a member of the REFERENCE "prac" that you passed to the function.
There is nothing illegal at all about getting a member of a referenced instance, no matter where. The fact that your
getAge method is static is IRRELEVANT.