게터, 세터

getter, accessor
게터, 액세서
setter
세터

1 게터[ | ]

  • 멤버 변수의 값을 얻는 메소드

2 세터[ | ]

  • 멤버 변수의 값을 지정하는 메소드
class Student {
    private $name;
    public function getName() {
        return $this->name;
    }
    public function setName($newName) {
        $this->name = $newName;
    }
}

3 같이 보기[ | ]

4 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}