Welcome to JavaRanch.
Those two pieces of code are not the same. Please
use code tags when you post code on JavaRanch, so that the formatting of the code is preserved.
The first piece of code is the same as this here below.
Do you now understand how it works?
The second piece of code does not compile because the statement "return true;" is unreachable.