by embair 2011-06-09, 21:32
I skimmed through the videos and gotta say that guy seems pretty clueless. Even if I overlook the fact that he is oblivous to the meaning of the this keyword. No decent java programmer would start a class name with lower case for instance. I guess the tutorial is somewhat usable, but be prepared that you might learn a bunch of bad coding practices in the process. But enough rumbling.
For the general meaning of the this keyword
1. Completely and thoroughly forget what the guy in the video says.
2. Refer to Fillers post.
As for the multiple constructors example in the video. It shows a special usage of this keyword, which is allowed only at the beginning of constructors. You got four constructors defined, but only one of them directly initializes the fields (the one that takes three parameters). Let's call him the smart guy. The other three constructors just know how to call the smart guy with some parameters. So, when you call
tuna tunaObect = new tuna();
the following happens:
1. the constructor tuna() is called
2. but he's like "meh, screw this, let the smart guy do it"
3. thus, the constructor tuna(0,0,0) is called
The second line illustrates the meaning of the this(0,0,0); statement.