When starting the loop, it displays twice the string at once. “Enter the surname and name, and press ENTER:”. Where did you miss?
int weight = 0;
INT COUNT = 0;
System.out.PrintLN ("Enter blah blah blah and press ENTER:");
Scanner Scan = New Scanner (System.in);
Weight = scan.nextint ();
System.out.PrintLN ("Enter blah blah blah enter:");
Count = scan.nextint ();
ArrayList & LT; String & GT; ArrayList = New ArrayList & lt; & gt; ();
System.Out.printLN ("Enter Parameters");
For (int i = 1; i & lt; = count; i ++) {
System.Out.printLN ("Enter the name and name and press ENTER through the comma);
arraylist.add (scan.nextline ());
}
Answer 1
changed the penultimate line. Everything has earned. Thanks for the prompts.
int weight = 0;
INT COUNT = 0;
System.out.PrintLN ("Enter blah blah blah and press ENTER:");
Scanner Scan = New Scanner (System.in);
Weight = scan.nextint ();
System.out.PrintLN ("Enter blah blah blah enter:");
Count = scan.nextint ();
ArrayList & LT; String & GT; ArrayList = New ArrayList & lt; & gt; ();
System.Out.printLN ("Enter Parameters");
For (int i = 1; i & lt; = count; i ++) {
System.Out.printLN ("Enter the name and name and press ENTER through the comma);
arraylist.add (scan.next ());
}