For my study in the university I\'m forced to do some ugly java basics, like working without encapsulation, main method in the same class etc. (I do not want to open a discu
Because the static method main is a member of class Person and can thus access any private fields or methods in Person.
What are you worried about? That someone will write a class and then be able to access those methods from their own class?
If you're going to be concerned about anything, be concerned that you can access private fields in any class using reflection but even that's necessary for a lot of useful things.