What is Encapsulation in Java | Data Hiding | Setter & Getter | OOP | Most Asked Interview Question

preview_player
Показать описание
encapsulation is a programming technique that binds the class members (variables and methods) together and prevents them from being accessed by other classes.
To achieve encapsulation in Java −
Declare the variables of a class as private.
Provide public setter and getter methods to modify and view the variables values.

TAGS:
method overriding, what is method overriding, java method overriding, method overriding in java,method overriding with example, method overriding in java with example, runtime polymorphism, runtime polymorphism in java,java runtime polymorphism, late binding in java, dynamic polymorphism,method overriding in java with example program, polymorphism in java, java overriding concept,method overriding rules, rules of method overriding, why we use method overriding in java,late binding in java,private,public,access, getter,setter,oops concepts,data hiding,encapsulation example,,core java
Рекомендации по теме
Комментарии
Автор

finally someone explained this concept so clear and comprehensible. thank you!

xmorlanzz
Автор

not every class is example of encapsulation

rohitborra
Автор

We want subtitles because we are unable to understand your voice as you are going so fast

lucky-qzvx