title: Java - Getting min max numbers with Math.max and Math.min
body: <p>I am creating a program that allows the user to enter as many numbers as they want until they enter 0. Once they enter 0 the console diplays the highest and lowest values entered.</p>
  
  <pre><code>import java.util.Scanner;
  public class NumInput {
    public static void main(String [] args) {
      Scanner s = new Scanner(System.in);
      for (;;) {
        System.out.print("Enter a Value: ");
        int val = s.nextDouble();
        if ( val == 0) break;
        else continue;
      }
  
    }
  }
  </code></pre>
  
  <p>I don't know how to get the max and min values. I know I should probably use the Math class, but I have no idea how to put it into my code.</p>