I have created an array list with size 10. It was just fine with the first object in the array. But, then I figured out that user's input in the second object in the array got skipped. (It won't ask user to enter their name starting from the second object in the array)
for (int i = 0; i < 10; i++)
{
array[i] = new Homestay();
System.out.println("\nEnter Customer Name");
nama = keyboard.nextLine();
/*prob: the second array won't ask user their name.
if i write keyboard.nextLine(); again, it will ask
user's name(input), but it won't display the user's name(output).*/
Output:
The first object in the array list
Enter Customer Name /it can ask the user's name and it can also display the output/
Jungkook
The second object in the array
Enter Customer Name //this line got skipped
Enter Customer No