i have been getting this error, <identifier> expected

    System.out.println("Enter the name of the lab this computer is located: \t");
    room = scan.nextLine();
    while (room.length() == 0)
    {
        System.out.println("Error: This field cannot be empty");
        System.out.println("Enter the name of the lab this computer is located: \t");        }
        room = scan.nextLine();        
    }

    System.out.println("Enter the software set installed: \t");//THE ERROR IS IN THIS LINE
    softwareLev = scan.nextLine();
    while (softwareLev.length()==0)
    {
            System.out.println("Error: This field cannot be empty");
            System.out.println("Enter the name software set installed: \n");
            softwareLev = scan.nextLine();
    }

    //pLEASE HELP ME THANKS

Edited 3 Years Ago by mike_2000_17: Fixed formatting

System.out.println("Enter the name of the lab this computer is located: \t"); }

Remove the '}' in this line that is what causes the previous while loop to terminate "prematurely" and on the next '}' it terminates the method/class, so that the next statement "appears" to the compiler out-of-place.

while (room.length() == 0)
  {
    System.out.println("Error: This field cannot be empty");
    System.out.println("Enter the name of the lab this computer is located: \t"); } // this } closes the while
  room = scan.nextLine();
} // so this brace closes the method

I am fairly certain your "first" '}' commented above shouldn't be there.

This question has already been answered. Start a new discussion instead.