sc.nextline skips

Java
int option = input.nextInt();
input.nextLine();  // Consume newline left-over
String str1 = input.nextLine();
Source

Also in Java: