gpt4 book ai didi

java - 错误 : Unreachable code

转载 作者:行者123 更新时间:2023-11-29 07:35:42 27 4
gpt4 key购买 nike

<分区>

为什么这个方法会返回错误:Error: Unreachable code 谢谢!

public static boolean zeroCheck(double numberTwo, String operator) {

if (numberTwo == 0) {
return false;
if(operator == "/" || operator == "%")
System.out.println("You cannot use a zero to divide or mod.");
} else return true;
}
}

错误:

File: C:\JAVA\LABS\LabSix.java [line: 228]

Error: Unreachable code

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com