John Shaw

Greenhorn
+ Follow
since Mar 29, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by John Shaw

Hello, all!
I'm new to Java but I was going over the original problem here and I would like to offer my thoughts as to why removing the return in line 4 causes the compile-time error.
If a variable is declared final and the default constructor initializes the state of all members in the object, would it not make sense that the compiler would not allow a final variable to be uninitialized because of an empty construct body? In other words, the return is needed in the construct to at least initialize the final variable? Or am I totally wrong because the construct is explicit and the final variable is a class member and one has nothing to do with the other?
Or do I need to take up knitting instead of Java?