define encapsulation with an example
Answers
Answered by
13
In Object Oriented Programming,Encapsulation is defined as binding together the data and the functions that manipulates them. Consider a real life example of encapsulation, in a company there are different sections like the accounts section, finance section, sales section etc.
Encapsulation. Encapsulation is one of the four fundamental OOP concepts. The other three are inheritance, polymorphism, and abstraction. Encapsulation in Java is a mechanism of wrapping the data (variables) and code acting on the data (methods) together as a single unit.
Encapsulation. Encapsulation is one of the four fundamental OOP concepts. The other three are inheritance, polymorphism, and abstraction. Encapsulation in Java is a mechanism of wrapping the data (variables) and code acting on the data (methods) together as a single unit.
Similar questions
History,
8 months ago
Math,
8 months ago
Computer Science,
1 year ago
Computer Science,
1 year ago
Science,
1 year ago