B
Brian Munroe
Hello, I've got a return statement question. Is the following best
practice for setting return values? Is there a java (or any language
with try/catch) idiom for doing this?
thanks!
public class HelloWorld {
public HelloWorld{};
public int grabProcess(int processId) {
int retValue;
try {
// do something
..
retValue = 100;
} catch (Exception e) {
logger(e.printStackTrace());
retValue = -100;
}
return retValue;
}
}
practice for setting return values? Is there a java (or any language
with try/catch) idiom for doing this?
thanks!
public class HelloWorld {
public HelloWorld{};
public int grabProcess(int processId) {
int retValue;
try {
// do something
..
retValue = 100;
} catch (Exception e) {
logger(e.printStackTrace());
retValue = -100;
}
return retValue;
}
}