我试图运行一个do ...虽然条件不满足但由于某种原因我的代码每次都会循环,无论条件的值如何.我已经检查了我的调试器,并且变量的值是正确的,并且根据类似的逻辑满足了循环内的条件.由于某种原因,这!是行不通的.这是我的代码
do
{
if(isRaceHorse.equalsIgnoreCase("Y"))
{
System.out.print("Please enter the number of races your horse has been in >> ");
numRaces = input.nextInt();
input.nextLine();
System.out.println("Your horse is named " + name + " it is a " + color + " horse born in " + birthYear + " and it has been in " + numRaces + " races.");
}
else if(isRaceHorse.equalsIgnoreCase("N"))
{
System.out.println("Your horse is named " + name + " it is a " + color …Run Code Online (Sandbox Code Playgroud) java ×1