Array List Java
<p>I am trying to make below syntax correct. The first method seems to be working ok except it is not printing the element of myJobInQueue.get(0).<br>
Also I when I try to run the method "runAll" on the terminal window in BlueJ program (or debubber) it keeps running and never stops. how can I fix this to make stop when there is not enough time left? </p>

<pre><code>  /**
  * Run the first job on the queue if there is enough time on the clock and the job queue list is not empty.
  * And move the job to the finished jobs list.
  */

 public void runJob(){
   if(!myJobInQueue.isEmpty() &amp;&amp; myJobDuration &lt; myTimeLeft){
     myTimeLeft = myTimeLeft - myJobDuration;
     myFinishedJobs.add(myJobInQueue.get(0));
     System.out.println("Ajob is running"+ myJobInQueue.get(0));
     myJobInQueue.remove(0);
     ArrayList&lt;Job&gt;runingJob= myFinishedJobs;  
     System.out.println();
   }
    else {
     System.out.println("Enter the new job. or add the total duraion" );
   }
}

/**
  * Run all the jobs on the queue in order until it runs out of time.
 */   


public void runAll()
{

for(int i = 0; myTimeLeft &gt; 0 &amp;&amp; myTimeLeft &gt; myJobDuration;i++);
  {  

    runJob();
  }

}
</code></pre>
