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
Auf dieser Seite können Sie das Online-Video what is encapsulation in java | Encapsulation in Java | Detail | Hindi | mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Know Java 01 Januar 1970 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 29 Mal angesehen und es wurde von 1 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!