What's wrong with the code? It won't let me write the input for each one of them..I wanted to read how many editions, the year and city of each edition, and it jumps to the loop and won't let me put input.
public class Competition {
private static ArrayList<Edition> editions = new ArrayList<Edition>();
private static Scanner scan = new Scanner(System.in);
public static void main(String[] args) {
String newCity = null;
int newYear = 0;
int itineration = 0;
int numberEditions = 0;
Edition newEdition = new Edition(newCity, newYear);
System.out.println("How many editions would you like to create?");
numberEditions = scan.nextInt();
while (itineration < numberEditions) {
System.out.println("\nEnter the city and year of the Edition you would"
+ " like to create: ");
System.out.println("Year: ");
newYear = scan.nextInt();
System.out.println("City: ");
newCity = scan.nextLine();
editions.add(newEdition);
itineration++;
}
for (int index = 0; index < editions.size(); index++) {
System.out.println("Music Festival'" + editions.get(index).getYear()
+ ", "
+ editions.get(index).getCity());
}
}
}