title: Java LinkedList accessing 2nd element
body: <p>I have created a linkedlist which stores two elements. Can someone tell me how to access the second element. In this case, the <code>lastName</code></p>
  
  <p>This is what I came up with so far. </p>
  
  <pre><code>public class Bank
  {
    private LinkedList&lt;List&gt; words = new LinkedList&lt;List&gt;();
    public void startup()
     {
       words.add(new List("Fred","Cool"));
     }
  </code></pre>
  
  <p>This is my list class</p>
  
  <pre><code>public class List
  {
     public List(String name, String lastName)
     {
       this.name = name;
       this.lastName = lastName;
   }
  </code></pre>