The second code doesn't work because after the return false statement, the return true statement is not reachable so the compiler will complain.
On the other hand, the first code have a different exit point which will cause only one return statement will be executed. If s is not null then it return false, if null return true. [ January 03, 2008: Message edited by: I Wayan Saryada ]
you said, based on the condition it will return boolean value. That is wrong. Based on the sequence of statements placed in the method only it will return the boolean value. And i have used the same statements in both IF condition and inside the method. Could you please eaplain me how come that exit of the statements can differ
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus