This Keyword in Java Full Tutorial - How to Use 'this'

preview_player
Показать описание
What does the "this" keyword mean in Java? How and when do you use "this"? We'll cover all of that (and all of "this") in this video.

In Java, the keyword "this" can be confusing for beginners. What does "this" even really mean? How do I know when I have to use it, and what does "this" actually refer to when I do use it?

In this beginner Java tutorial video, we'll give a complete overview of the "this" keyword in Java. By the end of the vide you'll know everything you need to confidently use "this" in your Java programs.

Learn or improve your Java by watching it being coded live!

Hi, I'm John! I'm a Lead Java Software Engineer and I've been in the programming industry for more than a decade. I love sharing what I've learned over the years in a way that's understandable for all levels of Java learners.

Let me know what else you'd like to see!

Links to any stuff in this description are affiliate links, so if you buy a product through those links I may earn a small commission.

📕 THE best book to learn Java, Effective Java by Joshua Bloch

📕 One of my favorite programming books, Clean Code by Robert Martin

🎧 Or get the audio version of Clean Code for FREE here with an Audible free trial

🖥️Standing desk brand I use for recording (get a code for $30 off through this link!)

📹Phone I use for recording:

🎙️Microphone I use (classy, I know):

Donate with PayPal (Thank you so much!)

☕Complete Java course:

Рекомендации по теме
Комментарии
Автор

I've gotta say John, I am doing Java in Uni, and I have their book, and a few others, but your videos wipe the floor with them when it comes to clarity and explanations.
Seriously, if you aren't a teacher, you should be one.
I was disheartened when I was reading the course materials for my class, but just watching your videos has really helped with everything.
Thank you very much indeed.

lfcbpro
Автор

Your channel single handedly allowed me to pass my intro to java course. Went from failing to a 3.0.
Thank you!

luomle-fz
Автор

You make things look so much easier. I feel like I have watched perhaps an entire lecture after most (if not all) of your videos.
And I mean that in the best possible way. Keep being great, you certainly have a gift in teaching!

Clean_Slate
Автор

this keyword was so confusing to me as a beginner- more than most other concepts!!-video really nails it down, and helps reinforce my understanding

janelain
Автор

This was a great explanation of the "this" keyword, thank you so much!

JusQuelle
Автор

I am a beginner, so I guess it will take sometime to thoroughly grasp all at once.
Thanks for the explanation man!!

bhaweshpandey
Автор

Thank you John! I’m a sophomore Software Engineer, and you explain things much clearer than my professor ✨

ayenoodles
Автор

grabe ka na johnny, you really know a lot of work, legend

AeV_artss
Автор

Why is this guy so helpful, so much clarity & speed in teaching 😭😭😭😭

danial_amini
Автор

Best explaination on "this" keyword i have ever seen so far on Yt!!! Thanks a lot man🙏🙏🙏🙏🙏🙏

NovaEngineer
Автор

I am just learning Java (from mechanical engineering, career switch) and your videos are great.
Keep it up and Thank you !

IluSsIoNnN
Автор

Plz keep doing this in just a couple months you’ve provided so much value

wallywild
Автор

You explain it better than anyone, bc you inform us what we need to know NOT what you know.

-a
Автор

I think that using "this" in class methods, like constructor or getters and setters, is not for avoid confusing between the function parameter and the filed name.
The uses of "this" is for referencing the specific object in memory beacause we can have many other objects of the same class.

abdelkaderkaouane
Автор

I've watched a bunch of your videos today just in two hours and I'm amazed of how you make things look so clear in just seven minutes or so per topic :D Great job!

mariap
Автор

Thank you! I'm so appreciative of this that I'll watch the ad in its entirety so you can get some of the money!

sportingdirector
Автор

Omg been fighting with Intellij to understand getters, setters and constructors and watching This was an instant 4 piece! Thank you!!!

gigachard
Автор

Dang near perfect, and no, I don't have any complaint at all, except that in other languages some good developers felt that "this" was redundant in instance methods and should generally be avoided as noise (their approach was non-ideal when the natural name for a method parameter was the same as a data member, of course -- they would wind up having to munge those). On the theme of "I love how you do brief intros that don't overwhelm the learner with minor details without lying or teaching anything they will have to learn later" a very good book I am reading does just that. In a quest to prepare the reader for cert exams, they don't merely ignore stuff that isn't on the exam in that area, but actively make some misstatements that won't affect one's performance on the exam, but if you go beyond later, you will actively have to unlearn some "convenient lies" that they could have just ignored instead. It is a fine line, but you normally always land on the right side of it. There are extremely few "untrue statements" or "non-facts" found in your videos in service of making a good introduction. That is not easy to pull off, and I really appreciate it.

jvsnyc
Автор

The explanation is insanely clear! Saved me from another course tbh

tianyiyin
Автор

Your channel is fantastic. Please don't stop

dekumutant