我有一个非常简单的源文件 GuiApp1.java,我正在尝试用 cmd javac 编译它。它给了我警告:
C:\Users\Thakkar\Java>javac GuiApp1.java
Note: GuiApp1.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
所以我使用 cmd 作为 javac -Xlint GuiApp1.java 来编译源文件。
它给了我 6 个警告,例如
GuiApp1.java:48: warning: [rawtypes] found raw type: JComboBox
JComboBox fruits = new JComboBox(fruitOptions);
^
missing type arguments for generic class JComboBox<E>
where E is a type-variable:
E extends Object declared in class JComboBox
我该如何解决这个问题?