Encapsulation in Java Tutorial #83
Vložit
- čas přidán 1. 01. 2020
- $1,000 OFF ANY Springboard Tech Bootcamps with my code ALEXLEE. See if you qualify for the JOB GUARANTEE! 👉 bit.ly/3HX970h
Encapsulation in Java is accessing private variables using methods. These are also known as setters and getters!
I hope you enjoyed this video on how to use encapsulation in java :) -
Full Java Tutorial For Beginners Playlist: • Full Java Course by Al...
Free Tips: bit.ly/3U6HXcb
Disclosure: The Springboard link provided is linked to my affiliate account & supports the channel.
~
Alex Lee
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
You're a magician. You made every topics in Java understandable. Like wow. Just wow. Thank you very much!
For sure
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
Useful to note: most setter methods would include validation logic and checks. For example, check that age is greater than X for a student.
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 CZcams explaining it better than a University lmao 🤣
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 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.
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!! 😊
Alex, you rock! You have the gift of teaching. Keep it up and thank you for spreading your knowledge.
I wish I found this channel when I was in my java class. You explain it so clearly!
I had a lot of difficulty with this at first, you made this a lot simpler than I thought it was. Thanks!
The best short definition of encapsulation and fantastic explanation. Great video Alex.
You make the complicated topics so easy to understand. Thank you so much.
Hey Alex, Thanks so much for your videos. They're really helpful!
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!
You’re such a huge motivator! You make things possible to understand. Thank you
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.
Thank you for the very helpful and easy to understand video content, man!
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!
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❤️
You just made my life very easy in learning and understanding java concepts! THANK YOU! (Y)
i am so thankful that your channel exist thank you for sharing your time and effort
love the way you present the ideas
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!!!
Thank you Alex. You Made learning Encapsulation easier
This is awesome and so simply explained!
Yeah. It is too simple or maybe i already familiar with set and get
You teach in a very calm and peaceful manner it’s kinda relaxing to watch you teach
Alex, this was a great explanation. I am studying for an assessment for an entry-level job, so thank you
thank you for explaining this, i actually thought it was complicated
you're a life saver man, wish you all the best😊😊
You have a gift. Very clear and enjoyable. Well done!
Thank you man for your great efforts. I believe you are one of the best on CZcams keep up the good work.
great work on all of your explanations !
Your explanation was amazing Alex, the most understandable explanation ever keep it app bro
precise and easy way to explain it, ty💯
3 weeks ago OOP was a foreign concept and I dreaded it. Now I'm mastering it and ready for an interview!
please keep do what you are doing.I'm learning soo much thanks to you
Awesome vid, your explanations are spot on. God bless!
Great explanation bro! You presented the concept in a very simple language
Thank you so much. Keep going.... 🙏
very clear Thanks Alex
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.
Thank you, AWESOME Video! Very Helpful
Thanks man ♥️java is in ur blood...I thought of giving up java....but ur way of teaching changed mee...thanks dude
bunch of thanks Alex, you made my day
keep going, dude. it's very simple to understand
Hi, you are really good explaining java material. I am grateful to have found you
Arigato.
You've done the work so easily that it had made difficult for others to do.
Thank you, this made perfect sense for me!
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!
Love how you explain these concepts 💯
Very concise and useful. Thanks so much!
Thanks Alex for creating these videos, keep it up!!
Hey man love your videos!!!
Thanks so much for this video!
Nice work Alex!
Finally I get this...Thank you!
Man your videos are so great and to the point
Plus, you’re excellent at explaining 😍🥰
Thank you Alex.
Hey Alex could you possibly make a video on the merge sort algorithm?
You’re the best java teacher on CZcams 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 👀
I'm glad found this video. Learnt alot.. Thx
Thanks a lot Alex it is really helpful.
Bro you're a life saver! 10 mins of your content worth more than 2 hours with my professor
very true
Annnnd subbed! You're way better at explaining this than my profs. Cheers m8
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?
thanks of what you are doing i will maybe have the 99% more chanche to pass my exam... thank you Alex ! you're amazing!!!
Nice explanation Alex, and Thanks 😊
Very helpful for my final exams, apprecitaed sir.
Really helped, thanks so much!
excellent explanation. Helped me alot. thank you.
nicely explained.Thanks
Thx for that shortcut!!
Happy new year you teach very well by the way
Loved the video
awesome video my friend ! you're a smart dude
When I say you are a lifesaver, I mean it!!! Thank you Alex ❤
Can you make a video about composition next? Great content by the way, very helpful for me.
Great explanation. As always an excellent video :)
Great! I've learned a lot.
Wooooooooo you are great Alex.
Great and simple explaining👍
Thanks the video is very helpful
You are awesome 👏🏻. Thank you 🙏🏻
after many lecture watched finally u satisfy me ->🥰Thanks 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
tq lee its very nice explanation.
thank you so much!!!!!! your videos are very helpful
Thank you so much for it.
THANK YOU SO VERY MUCH !
I'M GRATEFUL
Excellent video
Hey Alex, could you make a video on making GUI? Thanks for the easy-to-understand java videos!
Thank you 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
Thanks a lot :) this is so goooddd :)
simply awesome man .......... love from india
5:30 "The point of encapsulation is to abstract the variables from the user to make it easier to use the object."
best teacher ever
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!
thank you god bless u this is really helpful
carrying me in my java course! thank you