Hi, I'm a student who has just started and I'm doing a homework, I have a problem with this code
import java.util.Scanner;
public class Ejercicio11 {
public static void main(String[] args) {
Scanner entrada=new Scanner(System.in);
System.out.println("Introduce tu nombre");
String nombre_usuario=entrada.nextLine();
System.out.println("Introduce tu primer apellido");
String apellido1_usuario=entrada.nextLine();
System.out.println("Introduce tu segundo apellido");
String apellido2_usuario=entrada.nextLine();
System.out.println("tu nombre es: " + nombre_usuario );
System.out.println("tu primer apellido es: " + apellido1_usuario );
System.out.println("tu segundo apellido es: " + apellido2_usuario );
}
}
The problem is that when I give Start to the console with the Eclipse, when I ask my name I must for example Francisco (and add a space) so that later I do not join with the other data in the other 3 data I must also put the space.
What would be the solution for not having to do that? I suppose it will be some error of my code.
Thanks