Comment on Tutorial - this keyword in Java By Jagan
Comment Added by : Al Scherer
Comment Added at : 2009-09-15 09:33:24
Comment on Tutorial : this keyword in Java By Jagan
I'm sorry but your closing statement...
"this is of no significant value in the examples just shown..."
... is not quite right. "this" is mandatory in your last code snippet (at least with Sun's Java 6). If you leave out the "this" references, you are actually assigning the constructor parameter values to the constructor's local variables - not to the instance variables.
And, to follow best practices, we'd make the arguments final so that, if we forgot the this's, the compiler would call it out for you.
- Data Science
- Cloud Computing
- Java Beans
- Mac OS X
- Office 365
- Tech Reviews
Subscribe to Tutorials
2. Hi,first of all thats for this code developer, its
View Tutorial By: Kathir at 2008-02-08 06:16:51
4. I did not get the same result for memcpy - e and f
View Tutorial By: dml at 2012-01-02 13:32:20
6. A more complete description of the common pitfalls
View Tutorial By: Phil at 2012-11-25 02:06:49
7. thank's for the info.. i've learned a lot.. now, i
View Tutorial By: farah talabo at 2012-01-08 23:55:14