Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试从 JCombo 框中取回对象列表
有人建议
private JComboBox<Object> levelComboBox; levelComboBox = new JComboBox<Object>(logLevel); levelComboBox.setEnabled(false);
但是我很困惑这是对象的数组列表还是对真正对象类的引用的引用?谢谢
查看 Oracle 网站上的泛型,这将解释它。
JComboBox<Object>是一个JComboBox可以用Objects填充的。该<Object>部分称为Generic,这里有一个关于它的教程。
JComboBox<Object>
JComboBox
Object
<Object>