jeudi 25 mai 2017

Compiling Error "else without if "

import java.util.*;
public class ttttt
{
public static void main (String [] args)
{
  Scanner kb = new Scanner(System.in);
  System.out.println("Please enter a grade >> ");
  String grade = kb.nextLine();

  if (grade.equalsIgnoreCase("High Distinction"))
  {
     System.out.println("Very well done");
  }
  else if (grade.equalsIgnoreCase("Pass");
  {
     System.out.println("well done");
  }
  else if (grade.equalsIgnoreCase("not pass");
  {
     System.out.println("need to work harder");
  }
  else
  {
     System.out.println("Questions are a good thing");
  }



 }

 }

im getting an error Else without if.. what is the problem here i have used correct semi'coloumns. can i get some help have i forgetten some syntax. thanks

Aucun commentaire:

Enregistrer un commentaire