Hello,
Please examine the code snippet below. I don't understand why K&B say that "reference variables must be initialized before the constructor completes." The code below compiles and runs just fine.
Thanks,
K&B Two Minute Drill Chapter 1 wrote:final variables have the following properties:
final variables cannot be reinitialized once assigned a value.
final reference variables cannot refer to a different object once the object has been assigned to the final variable.
final reference variables must be initialized before the constructor completes.
C:\temp>cat Final.java
C:\temp>vi Final.java
C:\temp>gvim.exe Final.java
C:\temp>javac Final.java
C:\temp>
java Final
thisReference says hello
10