title: How to create max method that gets 4 numbers and returns the maximum number?
body: <p>I'm trying to build a method that would get 4 numbers and returns the maximum number of them.</p>
  
  <p>I tried to write this code that gets 4 numbers but this not working:</p>
  
  <p>Input and output:</p>
  
  <pre><code>double a = Math.max(10, 5, 4, 3);
      System.out.println(a);
  
  public static int max(int a, int b, int c, int d) {
      if (a &gt; b &amp;&amp; a &gt; c &amp;&amp; a &gt; d)
          return a;
      if (b &gt; a &amp;&amp; b &gt; c &amp;&amp; b &gt; d)
          return b;
      if (c &gt; a &amp;&amp; c &gt; b &amp;&amp; c &gt; d)
          return c;
      if (d &gt; b &amp;&amp; d &gt; c &amp;&amp; d &gt; a)
          return d;
  }
  </code></pre>