title: Why compiler gives ambigious method call error?
body: <p>Here is a code snippet.</p>
  
  <pre><code>class BoxVar{
  
         static void call(Integer... i){
             System.out.println("hi"+i);
         } 
         static void call(int... i ){
             System.out.println("hello"+i);
         }
         public static void main(String... args){
                       call(10);
       }
  }
  </code></pre>
  
  <p>The program compiles fine. When i run the program, it gives me </p>
  
  <blockquote>
    <p>java: reference to call is ambiguous, both method
    call(java.lang.Integer...) in com.exams.BoxVar and method call(int...)
    in com.exams.BoxVar match</p>
  </blockquote>
  
  <p>Can someone explain me the reason?</p>
  
  <p>On top of it, i tried converting the first method to something like this.</p>
  
  <pre><code> static void call(Long... i){
                 System.out.println("hi"+i);
             } 
  </code></pre>
  
  <p>It ran fine. Can someone help me this problem? Thanks.</p>