【发布时间】:2010-12-05 10:54:23
【问题描述】:
如果我用 Java 写这行代码:
JOptionPane.showInputDialog(null, "Write something");
会调用哪个方法?
showInputDialog(Component parent, Object message)showInputDialog(Object message, Object initialSelectionValue)
我可以测试它。但在其他类似的情况下,我想知道会发生什么。
【问题讨论】:
-
这实际上是一个好问题,即使它是人为的(你永远不想调用第一个,因为它与
JOptionPane.showInputDialog("Write something");相同
标签: java parameters methods invocation