Java Tutorial for Beginners - 31 - Getters and Setters

preview_player
Показать описание
In this tutorial we will discuss getters and setters and encapsulating your variables.
Рекомендации по теме
Комментарии
Автор

You are truly the best I've seen on youtube at explanating Java concepts.

jameswhyte
Автор

I allready knew and used getters and setters, but i never thought about protecting your code like that, with those if statements. Great explanation, thank you.

thomaslinssen
Автор

I have never really understood the use of getters and setters. I have battled with these concepts for a long time! You explained it so simply. Thank you so much! You are awesome!

ezinneosuagwu
Автор

I'm currently taking APCS A and you're a godsend. I'm actually understanding things for the first time. Thank you!

dapianna
Автор

1 minute in and your video has already helped me immensely. Thank you so very much

MrGamerAsian
Автор

so basically in summary:

imagine if we have hundreds of methods
and we need to change a value of a variable many months later
but we forget the rules or conditions of a certain variable
thats why we make variables private
so only through the public methods: through the setter we can change a value, with the condition,
and through the getter, we simply just return the value.

Thank you this makes it so much clearer :)

crazyxs
Автор

I really like how you go step by step on where the value goes. That was needed because it was getting hard for me to understand what was going on when I was studying in my uni. I needed some kind of visual mapping

ZXbolterZX
Автор

Absolutely simple, intuitive and lucid.

abdullahiahmed
Автор

Larry, keep your Orcs at 9. Love it, lol

ink
Автор

THANK YOU!!! You are DA MAN!!

So I'm in this online class to learn Java (scratches head), now I know that I can just get youtube/EJ Media and learn it better.

owningyourfinances
Автор

That was a beautiful example that i understood well! Thank you.

h.cazador
Автор

Short and simple..thank you for such a clear explanation :)

anamikaahmed
Автор

Great tutorial and great example. Thanks man.

qazzy
Автор

im just trying to understand the getters and setters and im looking at as many explanations for this and why its needed, and this example with orcs, and that they dont fit in to the cave thing made everything clear now.

arisamatore
Автор

Great simple and clear explanation! :-)

josephgagnon
Автор

Thanks man, this tutorial is legendary

blakeharrison
Автор

Great explanation, I just have a question, so if we are going to use setters to initialize the instances variable of the class, why do we need a user defined contractors with parameters that will have no control on the user input to initialize the instance variable?

anasslyan
Автор

basically you made everything so easy.

hamzahayd
Автор

Great explanation, man. I had a hard time understanding this concept with how my professor teaches. You helped a lot, lol

FL.S
Автор

Guys, I `ve got a problem, the programm does not allow me to to put key-work "static" to the main method since it does not go along with "setHeight'. Help please

maksymkarunos