Possible Duplicate:
Is returning null bad design?
Suppose I have a prompt asking the user to enter something. If the user does not match my specifications, the else block returns null. Is this bad practice? If so, how could I repeat the prompt within the scope of the if/else block?
if( foo.equalsIgnoreCase( "y" ) ) {
return bar[x][y];
}
else if( foo.equalsIgnoreCase( "n" ) ) {
return bar[x++][y];
}
else {
return null;
}