Changing object name with input
<p>I'm a beginner in java and I was wondering if there was a way to change the name of an object in the main class with input? For example I got this code:</p>

<pre><code>while(!answer.equals("stop"))
    {
    //Enters book's information  and stores it in the object book1  
    System.out.println("Book-" + count);    
    title = input.next();
    author = input.next();
    ISBN = input.next();
    copies = input.nextInt();
    Book book1 = new Book(title,author, ISBN, copies);
    printLn("");
    printLn("Do you wish stop adding books? N || stop");      
    answer = input.next();
    }
</code></pre>

<p>I want to keep adding new books until I write stop when prompted but of course without changing the name it will keep adding the data to the same object. Is it possible or do I need to keep making new book objects with: Book etc = new Book(title,author,ISBN, copies)</p>

<p><em>"Correction to my code"</em>
Like Kevin mentioned, an array is the main idea to store these values but it can be full due to its static value but I could use an expandcapacity method for when n--books are entered and the array is full it expands the array in x size.  Thank you!  </p>
