The method won't take the variable that I assigned in return.
public static String agregarMain() {
Scanner in = new Scanner(System.in);
for (int i = 0; i < 1; i++) {
System.out.println("Ingresar nombre del software/topico");
String mainSeleccion = in.nextLine();
if (mainSeleccion == "") {
System.out.println("Invalid Selection, please try again");
i--;
continue;
}
return mainSeleccion;
}
}
I'm expecting to save the input response in mainSeleccion variable.