一部のデータを変更したいが、元の名前の一部を保持したい場合、Enter キーを押したときに次のユーザー入力にスキップするにはどうすればよいですか?
for (int i = 0; i < myVector.size(); i++)
{
System.out.println("Press Enter to skip to next input");
System.out.print("Enter Name: ");
//If user presses Enter/newline, go to the next part where it asks for Name2
Name = keyboard.nextLine();
System.out.println("You've entered: " + Name);
myVector.elementAt(i).setName(Name);
System.out.println("Press Enter to skip to next input");
System.out.print("Enter Name2: ");
Name2 = keyboard.nextLine();
System.out.println("You've entered: " + Name2);
myVector.elementAt(i).setName(Name2);
//...etc
}