9
같은 클래스에있는 다른 개체의 개인 필드에 액세스
class Person { private BankAccount account; Person(BankAccount account) { this.account = account; } public Person someMethod(Person person) { //Why accessing private field is possible? BankAccount a = person.account; } } 디자인은 잊어주세요. 나는 OOP가 개인 객체가 클래스에 개인임을 지정한다는 것을 알고 있습니다. 내 질문은 왜 개인 필드가 개체 수준 액세스가 …