저는 Java를 처음 접했고 while 루프는 실제로 이해하지 못합니다. '전사 클래스를 선택하고 캐릭터 선택 상자로 돌아가고 싶지 않다면'라고 말하고 싶습니다.while 루프를 이해하지 못합니다.
while (chooseCharacter = true){
String[] Character= {"Kitty", "Archer","Tank","Battlemage","Warrior"};
int characterSelect = JOptionPane.showOptionDialog (null, "Choose your class", "Class Selection", JOptionPane.YES_NO_OPTION, JOptionPane.PLAIN_MESSAGE, null, Character, "Warrior");
if(characterSelect == 4){
JOptionPane.showMessageDialog(null, "Warrior" + "\n" + "Attack 1: Slash" + "\n" + "10 Damage :: 98% Accuracy" + "\n" + "Attack 2: Spin Attack" + "\n" + "25 Damage :: 67% Accuracy");
String[] warriorChar= {"No", "Yes"};
int warrior = JOptionPane.showOptionDialog(null, "Would you like to choose Warrior as your class?", "Choose this class?", JOptionPane.YES_NO_OPTION, JOptionPane.PLAIN_MESSAGE, null, warriorChar, "No");
if(warrior == 0){
chooseCharacter = true;
}
if(warrior == 1){
chooseCharacter = false;
}
}