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.
我想将 Person 或公司对象添加到 arrayList,使用 JOptionPane 或任何其他可用选项的车辆类型。有没有办法做到这一点?要使用 JOptionPane 调用我的方法,并将其与车辆类型一起添加到数组列表中?
JOptionPane 不适用于对象创建,您必须在调用 JOptionPane 可见性之前创建对象。