I have the following code:
public class FlagApplication {
private Scanner keyboard;
....
private void insertNewRegistry(){
System.out.println("insira os dados de pessoa: nome, peso, altura, idade, sexo e bi.");
String nome = keyboard.nextLine();
System.out.println("nome: " +nome);
double peso = keyboard.nextDouble();
System.out.println("peso: " +peso);
int altura = keyboard.nextInt();
System.out.println(altura);
int idade = keyboard.nextInt();
System.out.println(idade);
char sexo = keyboard.next(".").charAt(0);
System.out.println(idade);
int bi = keyboard.nextInt();
}
....
}
The problem is that the first input to be assumed is the weight, rather than the name, that is, it does System.out.println("nome: " +nome);
and the name is empty ('') and waits for the weight instead of stay first waiting for the name