캡슐화: 두 판 사이의 차이

내용 삭제됨 내용 추가됨
MerlIwBot (토론 | 기여)
잔글편집 요약 없음
1번째 줄:
'''[[객체 지향 프로그래밍]]'''에서 '''캡슐화({{llang|en|[[:en:Encapsulation (object-oriented programming)|encapsulation]])}}'''는 [[객체 지향 프로그래밍]]에서 다음 2가지 측면이 있다:<ref>{{llang|en|Michael Lee Scott, ''Programming language pragmatics'', Edition 2, Morgan Kaufmann, 2006, ISBN 0-12-633951-1, p. 481: "Encapsulation mechanisms enable the programmer to group data and the subroutines that operate on them together in one place, and to hide irrelevant details from the users of an abstraction."}}</ref><ref>{{llang|en|Nell B. Dale, Chip Weems, ''Programming and problem solving with Java'', Edition 2, Jones & Bartlett Publishers, 2007, ISBN 0-7637-3402-0, p. 396}}</ref>
* 객체의 속성(data fields)과 행위(메서드, methods)를 하나로 묶고,
* 실제 구현 내용 일부를 외부에 감추어 은닉 한다은닉한다.
 
속성인 데이터와 메서드의 결합은 C++의 경우 멤버함수를 호출할 때 객체의 저장공간을 멤버함수에 넘겨 데이터 처리를 하도록 하는 방법을 사용한다.
9번째 줄:
== C++에서 접근지정자 ==
 
C++언어에서 은닉하는 방법으로 접근지정자를 사용 한다사용한다.
 
다음 3가지가 있다: