title: Method Overloading- Does invocation of method depends on method definition occurrence in Class
body: <p>I tried different combination of Method Overloading with Autoboxing and Widening. I got stuck in here.</p>
  
  <pre><code>public void bite(int a, byte b){
    System.out.println("here in int-byte");
  }
  
  public void bite(byte a, int b){
    System.out.println("here in byte-int");
  }
  </code></pre>
  
  <p>In main:</p>
  
  <pre><code>byte a=9,b=8;
  //int a=9,b=8;
  bite(a, b);
  </code></pre>
  
  <p>Here error</p>
  
  <blockquote>
    <p>The method <code>bite(int, byte)</code> is ambiguous for the type Overloading</p>
  </blockquote>
  
  <p>When I reverse the method definition occurrence like:</p>
  
  <pre><code>public void bite(byte a, int b){
    System.out.println("here in byte-int");
  }
  
  public void bite(int a, byte b){
    System.out.println("here in int-byte");
  }
  </code></pre>
  
  <p>Then error:</p>
  
  <blockquote>
    <p>The method bite(byte, int) is ambiguous for the type Overloading</p>
  </blockquote>
  
  <p>Please explain how this is happening.</p>