title: BlueJ is trying to run my Java program forever
body: <p>I've just started learning Java (I am a C#.NET programmer as well). I am trying to get multiple user inputs and add them to an array. After this, I calculate the average from the given values.</p>
  
  <p>For some reason, BlueJ will try to run my Java program forever. Meaning, It will keep showing the progress bar and will not open any console window.</p>
  
  <p>I'm not sure if it's something wrong with my code, or BlueJ, because I've never encountered a problem such as this one before.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>import java.util.Scanner;
  
  public class Problem22 {
    public static void main(String[] args) {
      Scanner scanner = new Scanner(System.in);
  
      int inputs = 2;
      int[] values = new int[3];
  
      while (inputs &gt; -1) {
        values[inputs] = scanner.nextInt();
  
        inputs--;
      }
  
      System.out.println(averageValue(values));
    }
  
    private static int averageValue(int[] values) {
      int sum = 0;
  
      for (int i : values) {
        sum += i;
      }
  
      return (sum / values.length);
    }
  }
  </code></pre>
  
  <p>Please help me try and find a solution.</p>