title: Queue that has objects returns true for isEmpty() Java
body: <p>I have a program that creates a queue, enqueues objects to the queue and then dequeues them one by one if the queue is not empty. The problem I am having is that the queue comes up empty each time it is checked. Print is called on the queue after enqueuing each object and it prints the queue's contents just fine. </p>
  
  <pre><code>import java.util.*;
  import java.io.*;
  public class Processor2
  {
  private LinkedQueue queue = new LinkedQueue();
  private int time = 0;
  private int count = 100;
  private int amount = 0;
  private PrintWriter out;
  private Person temp;
  private boolean var;
  private Random randomNum = new Random();;
  private String turn;
  private int popCount=0;
  private int loopCount =0;
  
  public void start()
  {
      amount = randomNum.nextInt(5);
      amount += 5;
      pop(amount, time);
      sim();
  }
  
  public void pop(int num, int time)
  {
  
          for(int i=1; i&lt;=num; i++)
          {
              Person pe = new Person(i, time, 0);
              queue.enqueue(pe);
              System.out.println(queue);
          }   
          popCount += num;
  }
  
  public void sim()
  {
      try
      {
          out = new PrintWriter(new FileWriter("output.txt")); 
  
          while(loopCount&lt;=100)
          {
              var = queue.isEmpty();
              if(var=true)
              {
                  System.out.println("queue is empty");
              }
  
              if(var=false)
              {
                  Object temp = queue.dequeue();
                  double rand = Math.random();
  
                  if(rand &lt; 0.5)
                  {
                      System.out.println("inside if else statement");
                      // does stuff with object //
                      loopCount++;
                  }
                  else
                  {
                      System.out.println("inside if else statement");
                      // does stuff with object //
                      loopCount++;
                  }
              }
          }
          out.close();
      }
      catch (IOException ioe)
      {
          System.out.println("Error Writing to File: " + ioe);
      }
  }
  }
  </code></pre>
  
  <p>there doesn't seem to be anything wrong with the queue's isEmpty() method, but here it is:</p>
  
  <pre><code>public boolean isEmpty() 
  {
      if(count == 0)
      {
          return true;
      }
      else
      {
          return false;
      }
  }
  </code></pre>