0 votes
in JAVA by
Why we need encapsulation in java?

1 Answer

0 votes
by

Encapsulation in Java is a mechanism of wrapping the code and data (variables)acting on the data (methods) together as a single unit. In encapsulation, the variables of a class will be hidden from other classes and can be accessed only through the methods of their current class.

Related questions

+1 vote
asked May 2, 2021 in JAVA by sharadyadav1986
+1 vote
asked Jan 20, 2022 in JAVA by rajeshsharma
...