title: Min value of array returns as 0
body: <p>I'm having problems figuring out why returns for my minimum value in my array keep ending up as 0. I've checked several questions with the same problem but can't use those solutions because my array is being created in one method and my min/max values are calculated in another method.  </p>
  
  <p>Is there anyway I can keep my min/max value in a separate method and still get a non-zero answer for my min value?  Also, there is more code in the processSalesReport method but I left it out because it was irrelevant. Thanks ahead of time!</p>
  
  <pre><code>import java.util.Arrays;
  import java.util.Scanner;
  
  public class CarSalesReport {
  
  int sum;
  int count = 0;
  int[] num = new int[1500];
  String ans = "";
  Scanner userInput = new Scanner(System.in);
  
  public CarSalesReport(Scanner input) {
      String regex = "\\d+|done";
      System.out.println("Type sales (type \"done\" when finished)");
  
      do{
          System.out.print("Sale Number " + (count + 1) +  ": ");
          ans = userInput.nextLine();
          while(!ans.matches(regex)){
              System.out.println("Please enter a positive number");
              ans = userInput.nextLine();
          }
          if(!ans.equalsIgnoreCase("done")){
              int ans1 = Integer.parseInt(ans);
              num[count] = ans1;
              count++;
          }           
      }while(!ans.equalsIgnoreCase("done"));
  }
  
  public void processSalesReport(){
      int max = num[0];
      for(int a=0;a&lt;num.length;a++){
          if(max&lt;num[a]){
              max=num[a];
          }
      }
      //This is where I'm having my problems.  
      int min = Integer.MAX_VALUE;
      for(int a=1;a&lt;num.length;a++){
          if(min&gt;num[a]){
              min=num[a];
          } 
      } 
      Arrays.sort(num);
      System.out.println("\nMaximum sale: $" + max); 
      System.out.println("\nMinimum sale: $" + min);
  
  }
  }
  </code></pre>