Perhaps this will make a difference:
public void getData(Object o[]) { System.out.println("In Side Array"); } public void getData(Object o) { System.out.println("In Side Object"); } public static void main(String[] args) { Object[] array = null; new JavaEx().getData(array); }
In this implementation, "In Side Array" will also be printed, since an uninitialized array may be null . Therefore, it becomes apparent that the array method is being called.
source share