Encapsulation in Java is a powerful mechanism for combining the data members and methods of a class together and secure field accessible by only the members of the same class.
By encapsulating a class's variables, other classes cannot access them, and only the methods of the class can access them.
Syntax:
Access_Modifier class Class_Name {
private Data_Members;
private Data_Methods;
}
Need Encapsulation
Better Control
Getter and Setter
Security
Flexibility
Data hiding is a procedure done to avoid access to the data members and data methods and their logical implementation. Data hiding can be done by using the access modifiers. We have four access modifiers
Default
Public
Private
Protected
For more updates join our telegram group:-https://t.me/knowjavaprograming
Oops Playlist link:-
• Playlist
encapsulation in java
java encapsulation
encapsulation interview questions in java
encapsulation program in java
encapsulation in java with example
#JavaOOP
#JavaObjectOrientedProgramming
#JavaInheritance
#JavaPolymorphism
#JavaEncapsulation
#JavaAbstraction
#JavaClassesAndObjects
#JavaObjectCreation
#JavaConstructor
#JavaInterface
On this page of the site you can watch the video online what is encapsulation in java | Encapsulation in Java | Detail | Hindi | with a duration of hours minute second in good quality, which was uploaded by the user Know Java 01 January 1970, share the link with friends and acquaintances, this video has already been watched 29 times on youtube and it was liked by 1 viewers. Enjoy your viewing!