I have the following code
import java.util.List; public class Sample { public static void main(String[] args) { test(null); } static void test(List<Object> a){ System.out.println("List of Object"); } static void test(Object a){ System.out.println("Object"); } }
and I got the following output in the console
List of Object
Why does this call not call test(Object a) ? Can you explain how this took List as null ?
source share