This is my code
The error falls around this part of the code:
public void Crearusuario() {
String user = "";
String password = "";
Scanner scanner = new Scanner(System.in);
System.out.print("Escribe un nombre de usuario: ");
user = scanner.nextLine();
System.out.print("Escribe una clave: ");
password = scanner.nextLine();
String hashedpassword = Integer.toString(password.hashCode());
userdata.put(user, hashedpassword);
datab.put(user, datos);
// scanner.close();
}
The output is
Escribe un nombre de usuario: Exception in thread "main" java.util.NoSuchElementException: No line found
at java.base/java.util.Scanner.nextLine(Scanner.java:1651)
at Terminal.Crearusuario(Terminal.java:40)
at Terminal.main(Terminal.java:133)