title: Accessing an object class variable in ArrayList (java)
body: <p>So, let's say i have a class to describe a book</p>
  
  <pre><code>   public class Book {
       String name;
       int pages;
       String auother;
       boolean available;
       String rentername;
    }
  </code></pre>
  
  <p>Now, i have set an array list to contain the unknown numbers of books i wish to have/add/delete during the running time.
  The thing is, when i try to accesses a certain book in the arraylist by an index i get an error.</p>
  
  <pre><code>enter code here
  
  ArrayList Books = new ArrayList();
  Book bk1 = new Book();
  Books.add(bk1);
  System.out.println(Books[0]. ---&gt;&gt;&gt; won't give me accesses to the 'Book' class variables (name, pages...)
  </code></pre>
  
  <p>So, how can i make it to the class variables?
  Thanks.</p>