swaraj gupta wrote:
Got your point to some extent. Will you please explain your answer in terms of examples i have given here..?
The compiler doesn't check the condition, but checks the syntax. And, the compiler checks, whether in all condition, you've return a
String from that method. Did you returned in all ways that compiler expects?