TOPIC

Why do i get runtime error in this?

jsultana4 asked 5 years ago

import java.io.BufferedReader; import java.util.Scanner; public class polyglotParrot { public static void main(String[]args) { Scanner sc=new Scanner(System.in); String inp; while((inp=sc.nextLine())!=null) { if(inp.length()>6 && inp.length()<9) { if(inp.equals("esquerda")) System.out.println("ingles"); else if(inp.equals("direita")) System.out.println("frances"); else if(inp.equals("nenhuma")) System.out.println("portugues"); else if(inp.equals("as duas")) System.out.println("caiu");

        }
}
}

}

Remember not post solutions. Your post may be reviewed by our moderators.

  • pazuzu replied 5 years ago

    As stated in submit page, java classes MUST be named Main in order to the program run.

    /**
     * IMPORTANT: 
     *      Class name must be "Main" for your solution to execute
     */