Java GETTER and SETTER tutorial to get and set Field Variables. Object Oriented Java Tutorial #9.2

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

Java Beginner Tutorial for GETTER and SETTER. How to use it and why do we need it? Well explained video. They are used to instantiate the FIELD Variables. They are also alternative to using Constructors in java.

.
Please donate and support my work
(If you think my free tutorials are better than paid ones :)

Free Programming courses:

Free Flutter course:

Free Android courses:

More free programming courses:

Check out my website:

Let's get in touch! [Sriyank Siddhartha]

---- Thank you for your love and support ----
Рекомендации по теме
Комментарии
Автор

Perfectly explained. You actually show what happens to "pug" and where it gets replaced. Excellent! Thanks!

blockbusterlatefees
Автор

No one, I repeat NO ONE was able to explain this to me this well. Thank you so much, I do not know if I am dumb or what, but I struggled so much with this. I understand other Java concepts pretty well, but this one was a nightmare to me. I thought about giving up and setting the variables the other way forever, but I knew there would be situations where I would have to make variables hidden like this. Thank you, thank you so much.

minoanlight
Автор

I am a beginner and you have not given the basic explanation of "WHY" are we not supposed to access the variables DIRECTLY. That would certainly help in boosting fundamentals of a beginner like me. But overall good one. Thank you.

deepaknagadi
Автор

Awsum Work .. actully i am learning through another persons video tutorial, but when i got stuck in any thing, always found solution in your tutorials, so simple yet so clearing .. Awsum work love from Pakistan .

maizazuddin
Автор

The only video that i understood perfectly. subbed.

agosolsgaming
Автор

For those asking "tell us how to use it".

ok these are used ideally in game development but can be used for other purposes to o. most importantly you guys need to go ask yourselves a question and solve it. Thats how you learn programming, it is not learned by just listening.

for example if I were to learn SQL, i would need to ask myself,

Use adventureWorks2014 and Get me all the sales which has more than 5 products, get customer details, the dates should be UK format. and make a full name.

when trying to answer that question, in the process I will learn SQL. so you guys need to go out and make scenarios in your mind and try to solve them.

xxxx-kvei
Автор

you explained very well no doubt but you have additionally include what is the use of this method and why we are using these type of methods in java
because we have learned these types of concepts but where it will be used in right way we don't know so i hope you will explained in future videos

boominathanarumugam
Автор

fantastic explanation and simple and to the point

hardikseth
Автор

I can't thank you enough. You understand this and it's obvious in your explanation. Thanks.

emekamgbemere
Автор

Thanks my friend really well explained

juandavidgomezrestrepo
Автор

Can you please explain how the getter and setter work in case when we enter values dynamically using input fields in run time...I mean how it will set the values? Will it take values directly from fields or from database?

divyalakshmithota
Автор

Can't we use set and get methods in different functions separately?

erangachamini
Автор

Sir what's the advantage of setter and getter over directly accessing variables using dot operator ( .

KD-xiwu
Автор

Ma Sha Allah ... Very Helpful indeed :) Thank you !

sarmadnadeem_
Автор

thank u so much..it was easy to understand

milankbudha
Автор

wow it you have an amazing tutorial in java. I have learned a lot. Keep the good work brother!!!

itheblackwolfofmyfamily
Автор

Awesome Explanation. (Y) Very good !
but, isn't should be in code at 2:25 dog1.setBreed("pug");

shahriarmim
Автор

is getBreed() contains the value of breed

amitkadam
Автор

I have created a pojo class with setters and getters. In class A I have set the values and in class B I wanted to get the values . Kindly help me how to create object and get the values

nikhithanikki
Автор

Must we always use setter and getters? Can't we just retrieve the information directly from the database? I at times always get a null pointer exception with setter and getter...

mervinlee