8.2 Encapsulation Example in Java

preview_player
Показать описание


Recommend Books :

Follow on Facebook:

Subscribe to our other channel:
Telusko Hindi :
Encapsulation is one of the four fundamental OOP concepts.

Encapsulation is the technique of making the fields in a class private and providing access to the fields via public methods.

If a field is declared private, it cannot be accessed by anyone outside the class, thereby hiding the fields within the class.

Рекомендации по теме
Комментарии
Автор

Sir, you are a blessing. Keep spreading knowledge!

vidhya
Автор

As always u've nailed it sir!!....awsme u were my tutor.. you gonna b famous among students like us :)

Kitty
Автор

Thanks Naveen, I am clear with concept and prog.. part and cont. with rest of oops.

akbarhussain
Автор

Reddy you are the care of address for confusion. I'm Watching your videos from last 4 hours.
As of now i learned something java over the internet, Today i forget everything. You have such unbelievable capacity.(I.e eating minds)

kumar
Автор

Thankyou sir, your videos are of great help!

sanhitabhowmik
Автор

encapsulation in Java is a mechanism of wrapping the data (variables ) and code acting on the data (methods ) together as a single unit .

raviprakashchoudhary
Автор

Extremely helpful sir.thank you very much sir.

vineshramananathan
Автор

when I run the code on my eclipse which you represent to explain the example each and every time I got an error. Can u plz explain why?

ajaymaddi
Автор

can you please make a vedio about shortcuts using in net beans???

mohankiran
Автор

sir one doubt, when the methods are public and we can access them and using methods we are accessing the variables so how does Encapsulation provide security?

bittooaggarwal
Автор

to avoid accessing variable values, we are making it as private. but still we are able to make/get changes with set and get methods. how come this encapsulation improve privacy!!??

bhargavikommineni
Автор

hi ....what is the significance of using public method to access private methods I can access set n get private data members....

vishalkhulape
Автор

So why make the variables private? What benefit do you get?

MisterDibitybopty
Автор

What was the new (this..empID) command in set name???

mankit
Автор

how this is used and what is is the use of this here

RaviTejaAnonymous
Автор

Great... so, as a completely beginner in OO, I'd like to confirm: The encapsulation is done when you put "private" before the class class Emp attributes? (First day studying OOP, please, be nice everyone. Lol!)

ulysses_grant
Автор

what is purpose of creating getter method here? instead of getter method we can include the following line in setI method itself S.o.p(id); explain it please sit

rsridhar
Автор

What is wrong if we directly assign value to data members directly and what benefit we get if we define data members as a private.

muralimohanmajjiga
Автор

how to create calculator program in java using encapsulation plss help

yamsplacido
Автор

I'm getting an error of non-static variable this cannot be referenced from a static context.

SonuSharma-omwg