ok to explain my problem whats happening is
while (TimeLineSpace > 0) {
System.out.println("What would you like event " + Changer + " To say");
System.out.println("Currently Editing Event " + Changer + "..." );
String ScanResult4 = Scan.nextLine();
TimeLineInfo.put(Changer, ScanResult4);
TimeLineSpace--;
Changer++;
Inside this block of code (will show full program at end) Im trying to have the program summit a HashMap value overtime it goes around all in different keys. However what happens is when i run it (showing console)
What would you like event 1 To say
Currently Editing Event 1...
What would you like event 2 To say
Currently Editing Event 2...
//This part is not in console and right here though is a Scanner input which works
So to sum up my problem it skips the first Scanner input going only to the second and so forth which i have no idea why I have tried showing the value for 1 with a get(); however it returns nothing because it skips it not giving it any value well ill show the whole thing now to get a better understanding thank you so much if you could help
package learning;
import java.util.HashMap;
import java.util.Scanner;
public class TimeLine {
public static void main(String[] args) {
System.out.println("Welcome to a custom timeline");
System.out.println("What would you like to call your timeline");
Scanner Scan = new Scanner(System.in);
String ScanResult1 = Scan.nextLine();
System.out.println("We will now bring you to the edit section");
System.out.println("What would you like as the beg. of timeline");
int ScanResult2 = Scan.nextInt();
System.out.println("What would you like as the end of timeline");
int ScanResult3 = Scan.nextInt();
int TimeLineSpace = ScanResult3 - ScanResult2;
System.out.println("You have " + TimeLineSpace + " of space");
int HigestValue = TimeLineSpace;
int Finder = HigestValue - 1;
int Changer = HigestValue - Finder;
HashMap<Integer, String> TimeLineInfo = new HashMap<Integer, String>();
while (TimeLineSpace > 0) {
System.out.println("What would you like event " + Changer + " To say");
System.out.println("Currently Editing Event " + Changer + "..." );
String ScanResult4 = Scan.nextLine();
TimeLineInfo.put(Changer, ScanResult4);
TimeLineSpace--;
Changer++;
}
Scan.close();
}
}