MyungHoon_Ju

getter & setter

Q. Cash 클래스는 객체지향 스러운가?

class Cash {
    private final int value;
    
    public int dollars() {
        return this.value;
    }
}

class Cash {
    private final int value;

    public int getDollars() {
        return this.value;
    }
}