title: Java cannot find symbol - Methods not able to be accessed from a different class. Possible Java Generics or Inheritance misunderstanding
body: <p>So I am building onto (finishing) a program for homework that gives me a class that uses type parameters to build a linked-list data structure. The class has an inner-class that builds the nodes. Here is a simplified version of it...</p>
  
  <pre><code>public class LinkedList&lt;T&gt; {
      private static class Node&lt;T&gt; {
          public T data;
          //node next,prev variables + constructor
      }
      //methods to add, get, remove, etc nodes on the list  
  }
  </code></pre>
  
  <p>This class does great. No problems with it. Now I also have a gameBoard class...</p>
  
  <pre><code>public class gameBoard{
       LinkedList gameBoard;
  
       public gameBoard(){
           //create new board
           gameBoard = new LinkedList();
       }
  
       public void addPiece(int name){
           gamePiece newPiece = new gamePiece(name);
           gameBoard.add(newPiece);
       }
  }
  </code></pre>
  
  <p>And a gamePiece class...</p>
  
  <pre><code>public class gamePiece{
      int gamePieceName;
      public gamePiece(int name){
         gamePieceName = name;
      }
  
      //view game piece name
      public int viewPieceName(){
          return gamePieceName;
      }
  }
  </code></pre>
  
  <p>So the gameBoard has gamePieces, which are stored in a linked-list data structure. I am storing each individual gamePiece in a node, and each node is connected to the other pieces (next and previous), forming the board. I can insert gamePieces into the board (into the an instance of the LinkedList class and into a node), but when I access that node and the gamePiece within, I cannot call methods associated with the gamePiece (from the gamePiece class).</p>
  
  <p>When directly interacting with the gamePiece class via JGrasp, however, I can create a new instance of a gamePiece and play with its methods just fine. However, if I throw this piece into a node in a linked list, I want to be able to access the methods for the gamePiece still.</p>
  
  <p>Unfortunately, I get this error:</p>
  
  <pre><code>error: cannot find symbol
  return gameBoard.linkedList.getFirstNode().viewPieceName();
                                            ^
  symbol:   method viewPieceName()
  location: class Object
  </code></pre>
  
  <p>To clarify that error message, getFirstNode() is a method within the LinkedList class that gets the first node in the list (and returns the gamePiece object, not the whole node), and viewPieceName() is found within the gamePiece class. I can call viewPieceName() just fine by using JGrasp's interaction feature where I directly create a gamePiece object and mess with its methods. However, I cannot seem to access the methods through the LinkedList.</p>