package org.study.algos;
public class Study {
    public static void main(String[] args) {
       A a = new A();
       a.m1(null);
    }
 }
 class A {
    public void m1(String s) {
       System.out.println("String");
        System.out.println(s);
    }
    public void m1(Object obj) {
       System.out.println("Object");
       System.out.println(obj);
    }
}
Here, the output is
String null
Why does the JVM resolve the method to one with a String argument?
Thanks in advance J
 
     
     
     
     
     
     
     
    