What is encapsulation in java?
Answers
Answered by
3
Explanation:
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. ... Declare the variables of a class as private.
Hope it helps you
Answered by
3
Encapsulation,its name suggest when something when we read this word capsule related,exactally it same as capsule,you say how like capsule ,something wrapped medicine into single unit ,to remember definition you could remember name of capsule,in langauge of java its definition is :--
Definition :- Wrapping of data and it associated classes,functions into single unit is called Encapsulation.
For more java related doubts follow me,mark me brainlest if you like my way of explaination.
Similar questions
History,
6 months ago
Social Sciences,
6 months ago
English,
6 months ago
Math,
1 year ago
English,
1 year ago