Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Error de compilación
Main.java:1: error: class, interface, or enum expected Scanner myObj = new Scanner(System.in); // Create a Scanner object ^ Main.java:2: error: class, interface, or enum expected System.out.println("Enter username"); ^ Main.java:4: error: class, interface, or enum expected String userName = myObj.nextLine(); // Read user input ^ Main.java:5: error: class, interface, or enum expected System.out.println("Username is: " + userName); // Output user input ^ 4 errors |
||
#2 |
Error de compilación
Main.java:1: error: class, interface, or enum expected Scanner myObj = new Scanner(System.in); // Create a Scanner object ^ Main.java:2: error: class, interface, or enum expected System.out.println("Enter username"); ^ Main.java:4: error: class, interface, or enum expected String userName = myObj.nextLine(); // Read user input ^ Main.java:5: error: class, interface, or enum expected System.out.println("Username is: " + userName); // Output user input ^ 4 errors |
||
#3 |
Error de compilación
Main.java:1: error: class, interface, or enum expected Scanner myObj = new Scanner(System.in); // Create a Scanner object ^ Main.java:2: error: class, interface, or enum expected System.out.println("Enter username"); ^ Main.java:4: error: class, interface, or enum expected String userName = myObj.nextLine(); // Read user input ^ Main.java:5: error: class, interface, or enum expected System.out.println("Username is: " + userName); // Output user input ^ 4 errors |
||
#4 |
Error de compilación
Main.java:1: error: class, interface, or enum expected Scanner myObj = new Scanner(System.in); // Create a Scanner object ^ Main.java:2: error: class, interface, or enum expected System.out.println("Enter username"); ^ Main.java:4: error: class, interface, or enum expected String userName = myObj.nextLine(); // Read user input ^ Main.java:5: error: class, interface, or enum expected System.out.println("Username is: " + userName); // Output user input ^ 4 errors |
||
#5 |
Error de compilación
Main.java:1: error: class, interface, or enum expected Scanner myObj = new Scanner(System.in); // Create a Scanner object ^ Main.java:2: error: class, interface, or enum expected System.out.println("Enter username"); ^ Main.java:4: error: class, interface, or enum expected String userName = myObj.nextLine(); // Read user input ^ Main.java:5: error: class, interface, or enum expected System.out.println("Username is: " + userName); // Output user input ^ 4 errors |
Scanner myObj = new Scanner(System.in); // Create a Scanner object System.out.println("Enter username"); String userName = myObj.nextLine(); // Read user input System.out.println("Username is: " + userName); // Output user input