encapsulation

3,426 views

Published on

Published in: Technology, Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,426
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
134
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

encapsulation

  1. 1. SHALINI KUMARI SNEHA PRASAD RUCHI GUPTA 2nd yr C.S.
  2. 2.  INTRODUCTION  PRINCIPLE  CHARACTERISTICS  IMPLEMENTATION  FLOW CHART  PROGRAM OF ENCAPSULATION  BENEFITS  ABSTRACTION v/s ENCAPSULATION  USES  CONCLUSION
  3. 3. Encapsulation refers to the creation of self-contained modules that bind processing functions to the data. These user-defined data types are called "classes," and one instance of a class is an "object “.
  4. 4. Encapsulation is a process of binding or wrapping the data and the codes that operates on the data into a single entity. This keeps the data safe from outside interface and misuse. One way to think about encapsulation is as a protective wrapper that prevents code and data from being arbitrarily accessed by other code defined outside the wrapper..
  5. 5.  Improves the Understandability of the Application. Enhanced Security Maintenance of Application Easier
  6. 6. Encapsulation is most often achieve through information hiding , which is the process of hiding all the secret of an object that do not contribute to its essential characteristics,the structure of an object hidden, as well as the implementation of its method. Only the essential characteristics of object are visible.
  7. 7. #include<iostream.h> #include<conio.h> class college { private: int ccode; char cname[20]; public: read() { cout<<“enter the ccode and cname”; cin>>ccode>>cname; } write() { cout<<“code=“<<ccode<<endl; cout<<“name=“<<cname; } };
  8. 8. void main() { clrscr(); college c1; // object declaration c1.read(); // function calling c2.write(); getch(); }
  9. 9.  To allow one class ("server") to make a contract with another class(client) .  Data and Function may be public or private.  It hides the complexity from the implementation.  It also provide inter independencies.
  10. 10. Abstraction focuses upon the observable behavior of on object whereas…. Encapsulation focuses upon implementation that gives rise to this behavior.
  11. 11.  Through encapsulation , an interface is made available to world through which users can use the class .
  12. 12. It is the one of the important feature of oop. It is used to wrap the data and function together in a single unit. Thus, it also provide inter independencies.

×