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
En esta página del sitio puede ver el video en línea what is encapsulation in java | Encapsulation in Java | Detail | Hindi | de Duración hora minuto segunda en buena calidad , que subió el usuario Know Java 01 enero 1970, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 29 veces y le gustó 1 a los espectadores. Disfruta viendo!