This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
It didn't catch it because strictly its not a compilation error. Writing this:
Is synonomous with writing:
In English what your code is saying is "If a equals b, do nothing". Curly brackets define limits of blocks of code in Java. What defines what that block represents is the keyword used when the block is opened (try, catch, do, for, if etc.) If you don't define one, then the only effect they have is on the scope of valiables. For example:
is pretty much the same as:
However, brackets do make this possible:
because the scope of a is limited to what's in the brackets.