Object creation with different name
<p>Suppose I'm building a library class to keep track of my book purchases.
I would code something like the following to help me create book objects (don't mind too much about the specifics. This code is just to illustrate my question): </p>

<pre><code>public class MyLibrary {

 String bookName = "";
 String bookAuthor = "";
 double purchasePrice = 0.00;
 int printYear = 0;

  public Book(String name, String author, double price, int year) {

   this.bookName = name;
   this.bookAuthor = author;
   this.purchasePrice = price;
   this.printYear = year;
  }    
 }
</code></pre>

<p>And then I'm thinking of using a Scanner object in the main() parte of the program to help me introduce data and create book objects.
Something like: </p>

<pre><code>Scanner input = new Scanner(System.in);
System.out.println("Give a book name, please: ");
String bookName = input.next();
.
. (repeat for every other argument)
.
Book book1 = new Book(bookName, etc.,);
</code></pre>

<p>Now, I created this specific object - book1 - directly inside the code. 
But if I'm letting a user create new books, how can the program create objects with a different name/reference? </p>

<p>In other words, how can I make sure that new objects created by the user will be successively called book1, book2, book3, etc. or some other name choosen by the user?</p>

<p>Thanks.</p>
