Java Tutorial - 16 - Encapsulation

preview_player
Показать описание
In this video I will be giving you the next tool in your object oriented tool kit, encapsulation.

Just a reminder that my website is currently not available.
Рекомендации по теме
Комментарии
Автор

Advantages of encapsulation are
1. It helps you to control who accesses what like which function has access to a certain variable.
2. It makes a code more flexible and easy to change.
3. Using encapsulation the Unit test is easy to manage.
4. You can make changes to your code without affecting the other parts of the code.
5. It helps to create immutable class which is good in multithreading environment

theelegend
Автор

Man, I'd just like to thank you for this video. I just learned, in 8 minutes, much more than I learned of Java in 3 years in college. Wish my f*cking teacher could had such didatics in that time. Thanks A LOT.

ulysses_grant
Автор

This is so beautifully described, I did search for encapsulation and they did make it such a big thing, while it is a simple thing, you explained it well, thank you, subbed.

LegendColgo
Автор

can you explain where do we use encapsulation in real world while coding 

GoGetterGirl
Автор

I know, I just didn't want to confuse people by throwing it in there lol but yes you are 100% right when referring to instance variables it is always a good idea to use this.foo to make your code more readable

AbsoluteZeroBelow
Автор

how can i Encapsulate the methods when THEY are in Privite ?

brunopllumbi
Автор

Hi, this video says abt how to use encapsulation. I wud like to know as to why we need it in first place, wat happens if u dont use it, wat is encapsulation etc. Had been through some tutorials, didnt follow :(.

sujithks
Автор

can you make the video discussing the benefits?

onlinesoccertips
Автор

Do you need the getMethods in this example? Seems to run fine without them

Supcello
Автор

Hey. I'm very new to java and OOP. Could you tell me where is a good spot to start? I'm reading my uni book but often I just take notes without understanding and my prof doesn't do labs. Could you give me any hints as to where to start - and how to properly understand concepts of Java?
Thank bud, hope to hear from you soon!

nbama
Автор

What I don't understand is why do we even need get methods if we have the display method wich practicaly gets the value it's selfe?

t.z.
Автор

hey seeing as the website's not available would you care to explain why we need private variables? i mean i can understand some usefule examples where you may want two variables in seperate instances to have the same name but different data. past that im not sure why people keep praising them and saying they should be the primary type of variables

smmoom
Автор

What is the need of private variable with public method in encapsulation? rather then direct declare public variable

syedwaseemahmed
Автор

Thanks AZ...Good Show...Useful...Keep it up

ManishJoharle
Автор

There is an article up on my website that covers it very nicely if you want to give it a read :) it is right at the top of the news feed!

AbsoluteZeroBelow
Автор

zero, you kick ass! most of the videos on encapsulation are done by people who knows the concept but doesn't know any english!  well they do know english but their english is FKed up! anyways. mad props.

SuperNoomz
Автор

There is a link to my website in the description

AbsoluteZeroBelow
welcome to shbcf.ru