Answers

2014-12-29T18:53:53+05:30

This Is a Certified Answer

×
Certified answers contain reliable, trustworthy information vouched for by a hand-picked team of experts. Brainly has millions of high quality answers, all of them carefully moderated by our most trusted community members, but certified answers are the finest of the finest.
Encapsulation is to model a real life situation in to a computer program.

     Encapsulation method is used by Object oriented languages.  The real life problem to be solved is modeled into objects, properties and methods.  It is done in a manner to provide a secure and shared programming environment, where one's program is used by others in the project or by clients.

     Encapsulation is to create object classes for different types of  data we find in real life.  Then we identify the properties of the class.  We identify then the private properties and  public properties, which are accessible to users of the class.  The private properties are not directly visible to public users.  They can only be modified by  functions or methods provided by owner.

   The methods or functions of an object class are the functions or procedures that access (retrieve) the variables (properties) of an object or class and modify them.

   This a structured way of putting essential data as properties, and writing secure and safe methods to access them and modify them is encapsulation.  It is most important point of object oriented programming and DESIGN of  OOPS programs.

     The main use is to reduce corruption of data, introduction of bugs by a programmer, due to improper  handling of code.

example:
   A  student.

class  student  {
       private properties
         name  :  string of characters ;
          date of birth :  integer ;
      public properties :

     private methods:
           setName ( name ) ;
           setDOB ( date of birth)

     public methods :
           getName () ;
           getAge();

}


1 5 1
click on thank you and select best answer
there is no any other answer yet so...........................
ok