I have a question regarding return statements used within if() while() or for() statements. As you can see in the following method, it
if()
while()
for()
This will return the string only if the condition is true.
public String myMethod() { if(condition) { return x; } else return ""; }