Perfectly explained. You actually show what happens to "pug" and where it gets replaced. Excellent! Thanks!
@minoanlight45456 жыл бұрын
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.
@smartherd6 жыл бұрын
Thanks a lot. keep learning and.... *** Donate to support my FREE work ( If you like my work ) -- Why donate? -- If you think my videos are better than paid courses on Udacity or Udemy, then you must donate. The donation is optional and should be voluntary. Patreon: bit.ly/patreon-donate UPI: smartherd@okaxis Paypal / Payoneer: sriyank123@gmail.com
@qaautomationcult38684 жыл бұрын
Getters and Setters Getters and Setters are used to effectively protect your data, particularly when creating classes. For each instance variable, a getter method returns its value while a setter method sets or updates its value. getters and setters are also known as accessors and mutators, respectively. Please subscribe our youtube channel : kzbin.info/door/0xat537YITJbN_9GSMUALA Fb page : facebook.com/learn.automation.testing linkedin page : www.linkedin.com/school/14580724/admin/ website: www.qacult.com for various blogs and Upcoming Events
@qaautomationcult38684 жыл бұрын
Getters and Setters Getters and Setters are used to effectively protect your data, particularly when creating classes. For each instance variable, a getter method returns its value while a setter method sets or updates its value. getters and setters are also known as accessors and mutators, respectively. Please subscribe our youtube channel : kzbin.info/door/0xat537YITJbN_9GSMUALA Fb page : facebook.com/learn.automation.testing linkedin page : www.linkedin.com/school/14580724/admin/ website: www.qacult.com for various blogs and Upcoming Events
@rockmusicvideoreviewer8963 жыл бұрын
@@qaautomationcult3868 Spam
@rockmusicvideoreviewer8963 жыл бұрын
@@qaautomationcult3868 Spam 2
@maizazuddin65607 жыл бұрын
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 .
@agosolsgaming40362 жыл бұрын
The only video that i understood perfectly. subbed.
@smartherd2 жыл бұрын
Awesome, thank you!
@deepaknagadi6 жыл бұрын
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.
@smartherd6 жыл бұрын
Well the are few things which Google can tell you. Rest will be taken care by my videos. :P
@qaautomationcult38684 жыл бұрын
Getters and Setters Getters and Setters are used to effectively protect your data, particularly when creating classes. For each instance variable, a getter method returns its value while a setter method sets or updates its value. getters and setters are also known as accessors and mutators, respectively. Please subscribe our youtube channel : kzbin.info/door/0xat537YITJbN_9GSMUALA Fb page : facebook.com/learn.automation.testing linkedin page : www.linkedin.com/school/14580724/admin/ website: www.qacult.com for various blogs and Upcoming Events
@rockmusicvideoreviewer8963 жыл бұрын
@@qaautomationcult3868 Spam 3
@ujwalareddy-n7b Жыл бұрын
Awesome, Explanantion.🙌🏻
@emekamgbemere18014 жыл бұрын
I can't thank you enough. You understand this and it's obvious in your explanation. Thanks.
@juandavidgomezrestrepo61103 жыл бұрын
Thanks my friend really well explained
@hardikseth96402 жыл бұрын
fantastic explanation and simple and to the point
@kingsley156 жыл бұрын
Your variables should be *private* .
@MK-qz7sg5 жыл бұрын
why?
@kamalanb69305 жыл бұрын
@@MK-qz7sg getters and setters are mostly used to provide data values to private variable. To access data from public variable and provide it to a private variable we use getter and to set a value we use setter.
@masbro19014 жыл бұрын
@@MK-qz7sg for encapsulation.
@simm56223 жыл бұрын
Nicely explained 👍
@boominathanarumugam55896 жыл бұрын
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
@muslimquotesofficial6 жыл бұрын
U said it ...he should clearly explain the reasons
@xxxx-kv9ei6 жыл бұрын
ok these are used ideally in game development but can be used for other purposes to it. 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.
@sarmadnadeem_6 жыл бұрын
Ma Sha Allah ... Very Helpful indeed :) Thank you !
@smartherd6 жыл бұрын
Thanks, dont forget to visit our website www.smartherd.com/
@bushratarif60283 жыл бұрын
Wow, amazingly explain!
@xxxx-kv9ei6 жыл бұрын
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.
@mithunchandrasaha4033 жыл бұрын
Nice Explanation.Sir
@anwar69713 жыл бұрын
Explained so well. Thanks
@milankbudha4 жыл бұрын
thank u so much..it was easy to understand
@itheblackwolfofmyfamily6 жыл бұрын
wow it you have an amazing tutorial in java. I have learned a lot. Keep the good work brother!!!
@smartherd6 жыл бұрын
like and comment for each video. It helps us to grow. thanks alot
@abdulraffay19506 жыл бұрын
Man i love you !!! Thank you so much !!!
@sanilasabu58644 жыл бұрын
Well explained
@Iamnabink6 жыл бұрын
awesome video..Thanks for this kinda video..Keep it up.we love you
@KD-xi9wu3 жыл бұрын
Sir what's the advantage of setter and getter over directly accessing variables using dot operator ( . )???????
@smartherd3 жыл бұрын
Abstraction and encapsulation
@mahirbird90715 жыл бұрын
Good explanation. Thanks
@divyalakshmithota34444 жыл бұрын
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?
@cheshvikaraj77692 жыл бұрын
nice explanation
@Student-zc7hb3 жыл бұрын
Thnks.... simplicity...
@shahriarmim46966 жыл бұрын
Awesome Explanation. (Y) Very good ! but, isn't should be in code at 2:25 dog1.setBreed("pug");
@smartherd6 жыл бұрын
Yes. But here as mentioned at 2:29 that here pug is a string variable.
@IdlanRafiqi4 жыл бұрын
Then, what is the correct code? dog1.setBreed("pug"); or dog1.setBreed(pug); ?
@erangachamini1572 жыл бұрын
Can't we use set and get methods in different functions separately?
@theoriginyt48694 жыл бұрын
Coming from C++ and C#, I see no point in using these at all. Just use the field directly for even a better performance. Or use C# to specify if a variable should be only set privatly or be accessed by public...
@mathiasfantoni24584 жыл бұрын
I still don't get why we would use getter and setter way instead of just setting the variables public? What is the computational benefit of mutating them with methods rather than directly?
@jaibharatmata89214 жыл бұрын
Wow really nicce
@amitkadam23542 жыл бұрын
is getBreed() contains the value of breed
@salwas.alsubhi70137 жыл бұрын
Thank you, it's very Simple and helpfull
@smartherd6 жыл бұрын
thanks alot.. your comments are my motivation
@Mr_Unfazed06 жыл бұрын
Thanks a bundle sir 🙌 😃
@nikhithanikki84134 жыл бұрын
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
@nitish28083 жыл бұрын
How do I access a protected getter setter in another package in Java?
@mervinlee4504 жыл бұрын
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...
@Persian7717 жыл бұрын
Very good thanks.
@smartherd6 жыл бұрын
thanks alot.. your comments are my motivation
@srilekham82884 жыл бұрын
its not alternative method for using getter and setter methods.They are used when the variables are private
@praveenkumarelangovan97816 жыл бұрын
Play the video in 1.25x speed u will not get bored
@smartherd6 жыл бұрын
I prefer 1.5x
@ajithk21834 жыл бұрын
Thank you
@chandrasekhar63624 жыл бұрын
can we set the values in one request and can we retrieve in other request?
@flaasher6 жыл бұрын
Good job ...
@smartherd6 жыл бұрын
Thanks
@masbro19016 жыл бұрын
for what reason we should not access the variable directly ?
@lokeshdohare48725 жыл бұрын
mas bro it's a instance variable, u cannot access instance varaibles directly inside a method.. U either make object of that class and access it using reference variable or use getter and setter method as explained in video.
@tejaslokhande64526 жыл бұрын
Sir But anyone can access our data if he reads our code even if we have Encapsulated. Then how it works please help?
@thecreditcardrewards7 жыл бұрын
getter and setter are used to access private field using public method right? Then can we access private methods using the same strategy?
@thecreditcardrewards7 жыл бұрын
Great videos!I am learning java through your everyday modules 😃! Can getter and setter be static method?can it be another than public?
@smartherd7 жыл бұрын
The purpose of Getter and Setter is to be public or sometimes protected. But not private. and you can access private methods by calling a public method from outside the class.
@thecreditcardrewards7 жыл бұрын
Why to access private variables using public method?whereas we can access public field easily?
@smartherd7 жыл бұрын
Thankyou, You can provide me feedback to make my videos more clear and better. or if you find any better video on youtube then let me know.
@smartherd7 жыл бұрын
thats for this video was all about. Its always better to access field variables using getter and setter instead of doing it directly. The more in depth reason you will get to know while doing projects.
@kairiannah6 жыл бұрын
thanks
@smartherd6 жыл бұрын
Welcome
@himanshuyadav50073 жыл бұрын
But why this is not the way to it ?
@SaiKiran-xf4hx3 жыл бұрын
But u didn't say why???
@akashshrestha015 жыл бұрын
Cool
@UsmanAli-gb4bn6 жыл бұрын
perfect
@smartherd6 жыл бұрын
thanks a lot
@prostudioapp62657 жыл бұрын
Error:(17, 20) error: Cannot find getter for field. sir ihave 3 erore
@vaishnavinalawade99045 жыл бұрын
Liked....
@Josephine-ih8xw7 жыл бұрын
Thank u
@smartherd7 жыл бұрын
+josephine maria thank you
@AttitudeShorts3865 жыл бұрын
Bhai i need your attention
@ratmirsusanin54965 жыл бұрын
молодец
@jeevan43376 жыл бұрын
You or anyone please help me in this case? Will getter setter be useful here or someother approach? stackoverflow.com/questions/52953005/how-to-pass-values-in-java-from-one-class-to-another
@BoonkiCoC143 жыл бұрын
This is why i think java is so dumb. The getter and setter are doing exactly the same thing as the first code.
@rockmusicvideoreviewer8963 жыл бұрын
This is really a very horrible answer (your reply to some in the comments). If you come straight out and tell us in your video that one way is not a good way and to use a 2nd way instead, you better tell us why. Telling us in a comment to google it is wrong. Humble yourself and explain it in the comment and don't be afraid to admit when you are wrong. Otherwise you come off as someone that only cares about his own ego.