2014-02-23 3 views
0
 System.out.Println("Do you want to continue ?"); 
      if 
       (choice.equalsIgnoreCase("yes")||choice.equalsIgnoreCase("y")) 
       { 
        LinkedTeams.createList();  
       } 

      else 
       (choice.equalsIgnoreCase("no")||choice.equalsIgnoreCase("n")) 
오류가 아래의 문의 그렇지 않은 부분에서 발생

, 임 지금은 세미 콜론 실수 또는 일반 문제오류 : 진술이 아닙니다. 어떻게 수정합니까?

{ 
         MainMenu.MENU(); 
        }  
      }while()  

     } 

       public static void printList() 
          { 

           currentNode=headNode; 

           while (currentNode!=null) 
            { 
             System.out.println(currentNode.pokemonName); 
          Im unable to differentiate the difference between the two 

      System.out.println(currentNode.pokemonType); 

             currentNode=currentNode.next; 
       Just unable to find enough information     } 
          } 






} 
+0

코딩을 시작하기 전에 언어의 기초를 알아야합니다. http://docs.oracle.com/javase/tutorial/java/nutsandbolts/if.html – AJJ

답변

2
System.out.Println("Do you want to continue ?"); 
      if 
       (choice.equalsIgnoreCase("yes")||choice.equalsIgnoreCase("y")) 
       { 
        LinkedTeams.createList();  
       } 

      else if 
       (choice.equalsIgnoreCase("no")||choice.equalsIgnoreCase("n")) 

을 볼 수 없습니다이기 때문에 내가 뭘 잘못했는지 궁금 else는 이미 도달 부분이므로 명령문을 취하지 않습니다. "if"를 추가하면 해결됩니다.

관련 문제