It would be great if anyone can explain below. Why print(String s)
method is called in below example and print(Object o)
not called.
package com.example;
public class DemoTest {
public void print(Object o){
System.out.println("Object");
}
public void print(String s){
System.out.println("String");
}
public static void main(String[] args) {
DemoTest dt = new DemoTest();
dt.print(null);
}
}