If you’re new to programming but want a career in tech, I HIGHLY RECOMMEND applying to one of Springboard’s online coding bootcamps (use code ALEXLEE for $1,000 off): bit.ly/3HX970h
Yet another excellent explanation. Timestamps below for anyone who needs them: 1:00 Definition of encapsulation 3:03 How to use encapsulation with getters and setters 3:17 What static means 5:19 The point of encapsulation - extracting variables from the user 9:22 Summary of what encapsulation is
When we create a class with private members. What we are actually trying to do is create a user defined data structure. It helps us to store the data privately. It prevents direct access.
Alex, you've helped me get through all of the Java courses for my computer science degree. Thank you so much for the time you've put into making these videos and for helping me understand what my "teachers" are getting paid to do but failed miserably at!! 😊
You explained so clearly and precisely what my instructor took 2 hours explaining. I also enjoying copy-coding with you and then modifying my methods and variables for practice.
I'll eat my shirt if there's anyone out there who can explain java better than alex My college lectures are incomprehensible and i fall asleep 9/10 times.
This really made a difference to me. Now I know what I did have so much trouble to understand about Java, it was Encapsulation. And now Alex explained how it works. Thank you!
Currently in 2150 programming and my professors have been pretty iffy at explaining the terminology and what is actually going on but damn man you make this as clear as day.
thanks i was trying to understand from that one programming book my teacher recommended to me but couldn't understand much except for the different classes bit ,so really glad i clicked on your video thanks alot man your a life saver.
Also setters can be used for validating the data type. If you send a int to a String your program crashes but using the setters you can catch that and throw an exception or perform additional actions on the passed value to reformat before storing the value. Great vid as always.
That's not how java works, but for sonethibg like JS or Python, thos may be quite useful. Java is statically typed, so your compiler will conplain, if you try to pass an int to a function that expects a string
OMG, what you said, I deeply felt it. I went through a whole semester without knowing what OOP is, got 50% on final but still ended up with a B. I swear, in that online class I did everything I could, look for all explaination both from online and from her but I still didn't get anything. Now it just came to me after 5 mins watching you lol. Thank you, thank you, thankyou!
My man! These are some of the best explanations I have found regarding programing. Not just Java but Programing in general. Please share a PayPal or Patreon or other page where I can support you directly. I will not be purchasing the linked products or the full course (which I am completely sure is wort every penny and I will most definitely recommend to any folks looking to learn Java) but I still want to buy you a drink the least!
Hey Alex could you possibly make a video on the merge sort algorithm? You’re the best java teacher on RUclips and if you explained it I know for sure I would comprehend it. Thanks man.
Wow you make it seem so simple and understandable - super grateful to have found you; your videos would literally be how I will pass my end of year Java exam. Thank you! Looking out for your videos - keep striving!
Google can't explain this as well as you do. I just end up scrolling through complex "examples". I also like how you explain why you type the keywords in the methods. Keep up the nice work, really do appreciate it
When it comes to encapsulation. Mostly people talk about creating private instance variables and adding public getters, setters methods. That is true.at the same time we need to understand one thing. That is creating the data structure with required fields to store the data privately.
Thankyou so much I was falling behind on our lessons this past few weeks and having a hard time on understanding how to use encapsulation, since I was ill of covid❤️
Hey Alex , first of all thank you for your easy and simple explanation in addition to your calmness. Second thing is , Can you tell me how to write (System.out.print();) without writing it all as you did in the video please?
setters and getters are the simplest funcionts in OO, but for someone who has never seen codding it sooooo damn hard to *click* in the brain, but when it does oooooh if fells good
amazing teacher, I am I the only one who doesn't understand from the uni lecture or there are others having the same problem? because this is so simple why in the lecture seems so hard like its a chemistry! Thank you for the logic easy example
It is very Better To put Constructor instead Setters as Constructors get called once we create object so that will be easy for user.Your Explanation is wonderful Continue....
Really great tutorial, can't wait to see what else you have to teach. I was following along well enough and ran into a snag w/ the encapsulation between the two classes. I'm thinking its because I'm using a different IDE (intelliJ) that doesn't have the same robust options when it comes to creating a new class. Going to try with the IDE your using an see how it goes from there. Nonetheless, I still was able to understand what went where and why.
Ran the test code in Eclipse IDE and it went through as it should. Wondering what difference the IDE settings make? Only thing I can think of is that there was a confirmation request to run both classes in Eclipse where as it seems intelliJ only wants to run one. Wondering what it should be set as to allow both?
Hey Alex I love you and you videos, you truly are a hero among men...would you please think about making a video explaining the JRE, JVM, SDK, IDE, Java Library etc. These are very confusing topics but are necessary foundations for people using JAVA. I would really appreciate that. Also do you have a patreon account? I think you deserve to be rewarded by us for the tireless and amazing work you do
the thing im struggling to understand is what the actual purpose is of the private variables if you are just going to expose a method which can change the value. ill have to dig around more and see what I can find. The only thing ive found so far is not expose to a user but not sure what that means lol
Amazing video even for non java developers. Gone are the days of watching people write generic pseudo code about cars, thanks for actually explaining it in context yet still going into the theory for computer science students.
If you’re new to programming but want a career in tech, I HIGHLY RECOMMEND applying to one of Springboard’s online coding bootcamps (use code ALEXLEE for $1,000 off): bit.ly/3HX970h
Yet another excellent explanation. Timestamps below for anyone who needs them:
1:00 Definition of encapsulation
3:03 How to use encapsulation with getters and setters
3:17 What static means
5:19 The point of encapsulation - extracting variables from the user
9:22 Summary of what encapsulation is
You're a magician. You made every topics in Java understandable. Like wow. Just wow. Thank you very much!
For sure
When we create a class with private members. What we are actually trying to do is create a user defined data structure. It helps us to store the data privately. It prevents direct access.
Useful to note: most setter methods would include validation logic and checks. For example, check that age is greater than X for a student.
Alex, you've helped me get through all of the Java courses for my computer science degree. Thank you so much for the time you've put into making these videos and for helping me understand what my "teachers" are getting paid to do but failed miserably at!! 😊
In IntelliJ you can right click in the Student.java class, choose "Generate", choose "getter" or "Setter" and IJ will write the methods for you.
you can do that in Eclipse too!
You explained so clearly and precisely what my instructor took 2 hours explaining. I also enjoying copy-coding with you and then modifying my methods and variables for practice.
I'll eat my shirt if there's anyone out there who can explain java better than alex
My college lectures are incomprehensible and i fall asleep 9/10 times.
That’s why I didn’t go to college hahaha, some dude on RUclips explaining it better than a University lmao 🤣
Bro you're a life saver! 10 mins of your content worth more than 2 hours with my professor
very true
This really made a difference to me. Now I know what I did have so much trouble to understand about Java, it was Encapsulation. And now Alex explained how it works. Thank you!
I wish I found this channel when I was in my java class. You explain it so clearly!
You teach in a very calm and peaceful manner it’s kinda relaxing to watch you teach
Thanks man ♥️java is in ur blood...I thought of giving up java....but ur way of teaching changed mee...thanks dude
You make the complicated topics so easy to understand. Thank you so much.
please keep do what you are doing.I'm learning soo much thanks to you
Currently in 2150 programming and my professors have been pretty iffy at explaining the terminology and what is actually going on but damn man you make this as clear as day.
thanks i was trying to understand from that one programming book my teacher recommended to me but couldn't understand much except for the different classes bit ,so really glad i clicked on your video thanks alot man your a life saver.
The best short definition of encapsulation and fantastic explanation. Great video Alex.
Also setters can be used for validating the data type. If you send a int to a String your program crashes but using the setters you can catch that and throw an exception or perform additional actions on the passed value to reformat before storing the value.
Great vid as always.
That's not how java works, but for sonethibg like JS or Python, thos may be quite useful. Java is statically typed, so your compiler will conplain, if you try to pass an int to a function that expects a string
OMG, what you said, I deeply felt it. I went through a whole semester without knowing what OOP is, got 50% on final but still ended up with a B. I swear, in that online class I did everything I could, look for all explaination both from online and from her but I still didn't get anything. Now it just came to me after 5 mins watching you lol. Thank you, thank you, thankyou!
Very helpful for my final exams, apprecitaed sir.
3 weeks ago OOP was a foreign concept and I dreaded it. Now I'm mastering it and ready for an interview!
thanks of what you are doing i will maybe have the 99% more chanche to pass my exam... thank you Alex ! you're amazing!!!
I'm currently preparing for the AP CSA on my own and your videos are literally the reason I'm confident for the exam. Thanks a lot!!!
Arigato.
You've done the work so easily that it had made difficult for others to do.
Alex, you rock! You have the gift of teaching. Keep it up and thank you for spreading your knowledge.
My man! These are some of the best explanations I have found regarding programing. Not just Java but Programing in general.
Please share a PayPal or Patreon or other page where I can support you directly. I will not be purchasing the linked products or the full course (which I am completely sure is wort every penny and I will most definitely recommend to any folks looking to learn Java) but I still want to buy you a drink the least!
I had a lot of difficulty with this at first, you made this a lot simpler than I thought it was. Thanks!
Hey Alex could you possibly make a video on the merge sort algorithm?
You’re the best java teacher on RUclips and if you explained it I know for sure I would comprehend it. Thanks man.
Java is so hard you might need an expert for specifics.
@@Monster33336 youre making fun about java? Dude did you ever developed software professionelly ? Java is pretty complex language.
@@scholli99
just that Java is a nightmare when working with real objects not just system.out.println
You both are making it hard for starters like me to learn the language . No problem if it is hard or complex I will learn 👀
Wow you make it seem so simple and understandable - super grateful to have found you; your videos would literally be how I will pass my end of year Java exam. Thank you! Looking out for your videos - keep striving!
you're a life saver man, wish you all the best😊😊
Google can't explain this as well as you do. I just end up scrolling through complex "examples". I also like how you explain why you type the keywords in the methods. Keep up the nice work, really do appreciate it
This is awesome and so simply explained!
Yeah. It is too simple or maybe i already familiar with set and get
You’re such a huge motivator! You make things possible to understand. Thank you
Thank you Alex. You Made learning Encapsulation easier
i am so thankful that your channel exist thank you for sharing your time and effort
love the way you present the ideas
5:30 "The point of encapsulation is to abstract the variables from the user to make it easier to use the object."
When it comes to encapsulation. Mostly people talk about creating private instance variables and adding public getters, setters methods.
That is true.at the same time we need to understand one thing.
That is creating the data structure with required fields to store the data privately.
Please Continue Making Java Tutorials In RUclips, You're Amazing In your tutorials 👍💖
When I say you are a lifesaver, I mean it!!! Thank you Alex ❤
Your explanation was amazing Alex, the most understandable explanation ever keep it app bro
Thankyou so much I was falling behind on our lessons this past few weeks and having a hard time on understanding how to use encapsulation, since I was ill of covid❤️
Thank you, this made perfect sense for me!
Hey Alex , first of all thank you for your easy and simple explanation in addition to your calmness.
Second thing is , Can you tell me how to write (System.out.print();) without writing it all as you did in the video please?
best teacher ever
setters and getters are the simplest funcionts in OO, but for someone who has never seen codding it sooooo damn hard to *click* in the brain, but when it does oooooh if fells good
Alex, this was a great explanation. I am studying for an assessment for an entry-level job, so thank you
You have a gift. Very clear and enjoyable. Well done!
You just made my life very easy in learning and understanding java concepts! THANK YOU! (Y)
amazing teacher, I am I the only one who doesn't understand from the uni lecture or there are others having the same problem? because this is so simple why in the lecture seems so hard like its a chemistry! Thank you for the logic easy example
Alex is the best.
keep going, dude. it's very simple to understand
Thank you man for your great efforts. I believe you are one of the best on RUclips keep up the good work.
after many lecture watched finally u satisfy me ->🥰Thanks Alex
Damn dude, great explanation. Now I might pass my Java exam tomorrow, thanks!
Did you passed ?
wish java was depended on only one video
simply awesome man .......... love from india
You are a genius teacher.
Alex Lee, you are a real Bruce lee of Java. Thaks a lot for this n all ur videos.
It is very Better To put Constructor instead Setters as Constructors get called once we create object so that will be easy for user.Your Explanation is wonderful Continue....
Annnnd subbed! You're way better at explaining this than my profs. Cheers m8
Thank you for the very helpful and easy to understand video content, man!
very clear Thanks Alex
Nice work Alex!
everything is easy with Alex....i have hope in java bcz of u
Really great tutorial, can't wait to see what else you have to teach. I was following along well enough and ran into a snag w/ the encapsulation between the two classes. I'm thinking its because I'm using a different IDE (intelliJ) that doesn't have the same robust options when it comes to creating a new class. Going to try with the IDE your using an see how it goes from there. Nonetheless, I still was able to understand what went where and why.
Ran the test code in Eclipse IDE and it went through as it should. Wondering what difference the IDE settings make? Only thing I can think of is that there was a confirmation request to run both classes in Eclipse where as it seems intelliJ only wants to run one. Wondering what it should be set as to allow both?
Love how you explain these concepts 💯
thank you god bless u this is really helpful
Hey Alex, Thanks so much for your videos. They're really helpful!
You’re an excellent teacher
Hi, you are really good explaining java material. I am grateful to have found you
precise and easy way to explain it, ty💯
Hi, you're amazing. Im learning Java with you :) Firstly I tried with turkish channel but i didn't. We are waiting Pyhton, C++... THANKS
yea Python !
I think those who make Dislike are the teachers you've talked about
Hello Alex i'm studying in udemy just watched your videos for reference, but now i think i should use the udemy for reference.LOL
Alex return back. We need java tutoring classes. If u read this just confirm it
Great explanation bro! You presented the concept in a very simple language
thank you for explaining this, i actually thought it was complicated
Hey Alex I love you and you videos, you truly are a hero among men...would you please think about making a video explaining the JRE, JVM, SDK, IDE, Java Library etc. These are very confusing topics but are necessary foundations for people using JAVA. I would really appreciate that. Also do you have a patreon account? I think you deserve to be rewarded by us for the tireless and amazing work you do
That would be really nice
carrying me in my java course! thank you
Thank you so much. Keep going.... 🙏
Great and simple explaining👍
bunch of thanks Alex, you made my day
I'm glad found this video. Learnt alot.. Thx
Awesome vid, your explanations are spot on. God bless!
the thing im struggling to understand is what the actual purpose is of the private variables if you are just going to expose a method which can change the value. ill have to dig around more and see what I can find. The only thing ive found so far is not expose to a user but not sure what that means lol
Very concise and useful. Thanks so much!
Nice explanation Alex, and Thanks 😊
Thank you Alex.
Finally I get this...Thank you!
Thankyou so much dude you really help me for my exam From: Philippines
Thanks Alex for creating these videos, keep it up!!
He nailed it 🔥
excellent explanation. Helped me alot. thank you.
your content is amazing bro
Bro thank you so much
Thank so much my favorite teacher
Thx for that shortcut!!
Thanks a lot Alex it is really helpful.
Amazing video even for non java developers. Gone are the days of watching people write generic pseudo code about cars, thanks for actually explaining it in context yet still going into the theory for computer science students.
Nicely explained as usual - u r great man