title: Can you use Math.max with an array?
body: <pre><code>package prova1;
  
  import javax.swing.JOptionPane;
  
  /**
   *
   * @author OOO
   */
  public class Prova1 {
  
      public static void main(String[] args) {
          int array[] = new int[10];
          for (int i = 0; i &lt; array.length; i++) {
              String input = JOptionPane.showInputDialog("Insert number");
              array[i] = Integer.parseInt(input);
          }
  
          JOptionPane.showMessageDialog(null, Math.max(array));
  
      }
  
  }
  </code></pre>