3 건을 함께 1 건으로 묶으려고합니다.사례를 함께 묶는 방법은 무엇입니까?
어떻게하면됩니까? if, else if 및 else 문을 사용합니까? 그렇다면 어떻게? 당신이 break
을 포함하지 않는 자바
// Recourse
case 2:
// Turn Left Twice
state++;
if (state == 2) {
c = 3;
}
return this.buildPhysicalAction(TurnLeftAction.class);
// Move forwards
case 3:
c = 4;
return this.buildPhysicalAction(MoveAction.class);
// Turn right
case 4:
c = 1;
return this.buildPhysicalAction(TurnRightAction.class);
}
return this.buildPerceiveAction();
}
}
세 가지 경우에는 서로 다른 논리가 있습니다. 그룹으로 무엇을 달성하고 싶습니까? 여기서 "그룹 3 사례를 함께"의미하는 것은 무엇입니까? –
왜 그룹을 원하십니까? '2,3,4'은 다른 비즈니스 코드를 가지고 있습니다 – Jerry06
당신의 문제를 자세히 설명하십시오 –