//定义一个枚举类型
enum Result{
//成功和失败
//规范要求:大写
SUCCESS,FAIL //有限的.
}
Result retValue = divide(a,b);
if(retValue==Result.SUCCESS){
System.out.println("成功");
}else if(retValue==Result.FAIL){
System.out.println("失败");
}
try{
int c = a / b;
return Result.SUCCESS; //成功
}catch(Exception e){
return Result.FAIL; //失败
}