This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
When I run the following code which I got from Head First Java (it uses Java 5.0, by the way), I get the following error:
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous sym type: Accum.getAccum
Java Result: 1
BUILD SUCCESSFUL (total time: 2 seconds)
Here is the code:
Can anybody help me with this problem? I have marked the problem lines, by the way.
No idea. After fixing those two catch errors the code compiles just fine on my system (Windows 7, JDK 1.6.0_25). The results are random though, but that makes sense since there is no synchronization on the updating of the counter.