title: Convert object to string ( java )
body: <p>I have a question how to convert an object item to string , 
  in the source code here you can see that you can input  Object item as an object  , however I would want the  item  to be converted into a  string  so I can equal it to a string variable .
  Does anybody know how to do this ?</p>
  
  <p>Thank you</p>
  
  <hr>
  
  <pre><code>public QueueNode AddItem (Object item, int priority) 
  {
  
  
      PQNode newNode = new PQNode (item, priority);
      if (root != null) {
  
          spreadingOutToInsert (newNode);
  
          // if newNode equals or is greater than the root then  put the old root as the rightChild of the newnode
  
          if (newNode.compare (root) &lt; 0) 
  
          {
              newNode.leftNode  = root.leftNode;
  
              newNode.right = root;
  
              root.leftNode     = null;
  
              // if newNode equals or is greater than the root then just put the old root as the leftChild of the newnode
          } else 
          {
              newNode.leftNode  = root;
  
              newNode.right = root.right;
  
              root.right    = null;
          }; 
  
      }; 
  
      size++;
      return root = newNode;    // this is to make the newNode into the new root
  
  };
  </code></pre>