62,615
社区成员
发帖
与我相关
我的任务
分享
public static void main(String[] args){
double result = 1;
int b = 10;
int a = 0;
try {
result = b/a;
} catch (Exception e) {
result = 0;
}
System.out.println(result); //0.0
System.out.println(5/0.0); //Infinity
}