Which overload will get selected for null in Java?
问题 If I write this line in Java: JOptionPane.showInputDialog(null, \"Write something\"); Which method will be called? showInputDialog(Component parent, Object message) showInputDialog(Object message, Object initialSelectionValue) I can test it. But in other cases similar to this, I want to know what happens. 回答1: The most specific method will be called - in this case showInputDialog(Component parent, Object message) This generally comes under the "Determine Method Signature" step of overload