객체 지향

접근 제어 지시자(access modifier)와 정보 은닉(information hiding)

BEstyle 2022. 9. 22. 16:48

예를 들어,

public int month; 과 int month; 의 차이:

public을 작성하게되면 다른 class에서 ~.month = 100; 와 같이 데이터 오용이 일어날 수 있다.