Nice! This is a good way to overcome this situation.
Another approach would be to pass nextLine() to parseInt():
int year = Integer.parseInt(in.nextLine());
I like it better this way because for me it's less confusing than having a nextLine() lost between the lines.