私はこのコードを持っています:
byte[] nombre = new byte[20];
System.out.print("Cuenta a modificar: ");
cuenta = s.nextInt();
boolean existe = estaRepetido(cuenta);
if (existe == false){
System.out.println("La cuenta no existe");
}
else {
String nomCliente;
System.out.print("Nombre: ");
nomCliente = s.nextLine();
System.out.print("Cantidad: ");
double cantidad = Double.parseDouble(s.nextLine());
for( int i = 0; i < 20 && i < nomCliente.getBytes().length; i++ ){
nombre[i] = nomCliente.getBytes()[i];
}
String nomModificar = new String (nombre);
modificar(cuenta, nomModificar, cantidad);
}
しかし、ターミナルで実行すると、海外でnomCliente = s.nextLine(); 次のようなもので終わります:
Cuenta a modificar: 0
Nombre: Cantidad: 0
何か案は?これは非常に大きな方法の一部にすぎませんが、問題を引き起こしているのはこれだけです。