title: Recover attributes from Object variable
body: <p>So this is the context for my question. </p>
  
  <p>I created a singly linked list whose nodes' attribute is an Object variable so i can store objects from different classes. So far so good.</p>
  
  <pre><code>        public class Node 
      {
  
          Object data;
          Node next;
  
          public Node(Object data)
          {
              this.data=data;
              this.next=null;
          }
  
  [...]    
  
  }
  </code></pre>
  
  <p>Thing is i don't know how to recover attributes/methods from the stored objects. This one for example.</p>
  
  <pre><code>public class Product 
  {
      double discount;
      double price;
  
      public double getPrice() {
          return price;
      }
  
  [...]
  </code></pre>
  
  <p>Help.</p>