Create several new objects within a for-loop in Java
<p>I want to create several objects from a class in a for loop. but I don't know how to code it. What I have written creates a new object but it overwrites the previous object.</p>

<pre><code>package assginment1_version4;

import java.util.*;

public class Client {

public static void main (String[] args) {
    System.out.println ("this is a bill database");
    System.out.println ("add a user?(Y/N)");

    Scanner input = new Scanner(System.in);
    String answer = input.nextLine ();
    ArrayList ary = new ArrayList ();

    for (int i=1 ; i &lt; 100; i++) {
        if (answer.equalsIgnoreCase("y")) {
            Bill bill1 = new Bill();
            System.out.println("user first name:");
            bill1.setFname (input.nextLine());
            System.out.println("user Last name:");
            bill1.setLname (input.nextLine());
            System.out.println ("add a user?(Y/N)");
            answer = input.nextLine ();
        } else if (answer.equalsIgnoreCase ("n")) {
            if (Bill.getBillCounter () == 0) {
                System.out.println ("the Database is empty");
                break;
            } else {
                System.out.println ("Number of Users:  "
                        + Bill.getBillCounter ());
                break;
            }
        } else {
            while (!answer.equalsIgnoreCase ("n")
                    &amp;&amp; !answer.equalsIgnoreCase ("y")) {
                System.out.println ("add a user?(Y/N)");
                answer = input.nextLine ();
                }
            }
        }
    }
}
</code></pre>

<p>please help me to complete this code.</p>
