title: How to overload method running with other data type of parameters?
body: <p>I have a short program to test overload method in java.
  This is my code:</p>
  
  <pre><code>public static void main(String[] args) {
      // TODO code application logic here
      // Case 1
      f2(5);
      // Case 2
      char x = 'a';
      f2(x);
      // Case 3
      byte y = 0;
      f2(y);
      // Case 4
      float z = 0;
      f2(z);
  }
  </code></pre>
  
  <p>And there are my methods :</p>
  
  <pre><code>public static void prt(String s) {
      System.err.println(s);
  }
  
  public static void f2(short x) {
      prt("f3(short)");
  }
  
  public static void f2(int x) {
      prt("f3(int)");
  }
  
  public static void f2(long x) {
      prt("f5(long)");
  }
  
  public static void f2(float x) {
      prt("f5(float)");
  }
  </code></pre>
  
  <p>and this is result:</p>
  
  <pre><code>f3(int)
  f3(int)
  f3(short)
  f5(float)
  </code></pre>
  
  <p>I can't understand how does it running with case 2 and 3. Any explain for me ?</p>