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.
View Tutorial
- Data Science
- React Native
- Android
- AJAX
- ASP.net
- C
- C++
- C#
- Cocoa
- Cloud Computing
- HTML5
- Java
- Javascript
- JSF
- JSP
- J2ME
- Java Beans
- EJB
- JDBC
- Linux
- Mac OS X
- iPhone
- MySQL
- Office 365
- Perl
- PHP
- Python
- Ruby
- VB.net
- Hibernate
- Struts
- SAP
- Trends
- Tech Reviews
- WebServices
- XML
- Certification
- Interview
categories
Related Tutorials
Read a file having a list of telnet commands and execute them one by one using Java
Open a .docx file and show content in a TextArea using Java
Step by Step guide to setup freetts for Java
Of Object, equals (), == and hashCode ()
Using the AWS SDK for Java in Eclipse
DateFormat sample program in Java
concurrent.Flow instead of Observable class in Java
Calculator application in Java
Sending Email from Java application (using gmail)