if(amt > total) {
throw new InsufficientFundsException();
}
return total - amt;
}
public void process(boolean save, double amt) {
if(save) {
// save money
} else {
try{
double left = withdrawl(amt);
} catch(InsufficientFundsException e) {
// Handle Exception
}
}
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)