I canβt understand why this program prints a String
class AA { void m1(Object o) { System.out.println("Object "); } void m1(String o) { System.out.println("String "); } } public class StringOrObject { public static void main(String[] args) { AA a = new AA(); a.m1(null); } }
Please help me understand how this works to print Sting, not Object
source share