Java Tutorial for Beginners - 22 - using 'this' keyword with constructors

preview_player
Показать описание
using "this" keyword with constructors
Рекомендации по теме
Комментарии
Автор

For anyone that's confused this might help.

Here's an example without using this

public class Point {
public int x = 0;
public int y = 0;

//constructor
public Point(int a, int b) {
x = a;
y = b;
}
}

but it could have been written like this:

public class Point {
public int x = 0;
public int y = 0;

//constructor
public Point(int x, int y) {
this.x = x;
this.y = y;
}
}

nubeslayya
Автор

I got confused by all the usage of the word "This". Maybe shouldn't have named the file This and used This as your constructor. Still kinda confused. Love all your videos though, thanks so much.

coldlandolakes
Автор

Wish you SUCCESS in all what you choose to do

saumitrabhardwaj
Автор

I can't find your java lessons in the playlists

pover
Автор

I hope you can do android development in your next tutorial.

zedshockblade
Автор

Hi EJ, ....wassup. I am about to finish your beginner tutorials.Are you uploading intermediate Java anytime soon?

rbflowin_TV
Автор

what does the "this." in front of "this.one" mean? I'm a little confused on what it's doing and its purpose. Love your videos!

briannadeg
Автор

Thank you very much for your work. You explain things much better and more understandable than my college professor. Very helpful. 

hotice
Автор

Hi, luv ur tutorials, and its becoming clearer to me. I have been able to narrow down my confusion but I still don't get one thing. Why would the "placeholder name" and the "variable name" need to be the same, for the "this" keyword to be needed? Thanks

osaroekiyesamuel
Автор

It sounds like we're being thought Java by Owen Wilson lol. Great videos though :D

philgiblin
Автор

what the f did i just see. that's not what I was expecting from the title

serdashehu