Computer Science, asked by navdeep9007, 1 month ago

What is encapsulation in OOP?

Answers

Answered by rojalina1985mishra
2

Answer:

Encapsulation is one of the fundamental concepts in object-oriented programming (OOP). It describes the idea of bundling data and methods that work on that data within one unit, e.g., a class in Java. This concept is also often used to hide the internal representation, or state, of an object from the outside.

Answered by kavitasingh1234
2

Encapsulation

  • Wrapping up of data and Member function into single unit is known as Encapsulation .
  • Data encapsulation is the most important feature of class .
  • The data is not acceptable to the outer world
  • They can be accessed only by its method which are wrapped within the class .

____________________________

Method used as an interface between the data of object and the program the process of project data from Direct Access by a program is called Data hiding and information hiding .

Some information about OOP :-

The object oriented approach focuses on data rather than procedure and structures this is a method where programming is adjusted and modelled on the basis of real life entity and process .

For example in a school library system there are object like book , student and processes like book issue , book return etc .

oop approach allows the programmer to create data variable or object .

It divide the program into building blocks for all objects and then be used in data and methods around these object .

Elements of OOP:-

  1. data encapsulation
  2. data abstraction
  3. inheritance
  4. polymorphism

Similar questions