Код: Выделить всё
for(int i = 0; i < regArray.length; i++){
System.out.println("Registration number : " + Registration.getNextRegNo());
System.out.println("Enter name = ");
String name = sc.nextLine();
System.out.println("Enter IC name = ");
String IC = sc.next();
Owner owner = new Owner(name, IC);
System.out.println("Enter plate number = ");
String plateNo = sc.next();
System.out.println("Enter color = ");
String color = sc.next();
System.out.println("Enter year = ");
int year = sc.nextInt();
System.out.println("Enter car type = ");
for(int x = 0; x < carTypeArray.length; x++){
System.out.println(x + ": " + carTypeArray[x]);
}
int choice = sc.nextInt();
CarType carType = carTypeArray[choice];
Car car = new Car(plateNo, color, year, carType);
regArray[i] = new Registration(owner, car);
sc.nextLine();
}

Подробнее здесь: https://stackoverflow.com/questions/788 ... with-enter
Мобильная версия