比较下面两段代码:
import static java.lang.System.out;
......
out.println(“ ”);
.......import static javax.swing.WindowConstants.*;
//Warning: The import javax.swing.WindowConstants is never used
......
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
......为什么第二段代码会出现警告?
import static java.lang.System.out;
......
out.println(“ ”);
.......import static javax.swing.WindowConstants.*;
//Warning: The import javax.swing.WindowConstants is never used
......
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
......为什么第二段代码会出现警告?
警告:包含的javax.swingWindowConstants 没有被使用到。
删除该行即可。
this.setDefaultCloseOperation(EXIT_ON_CLOSE); 不是用到了 javax.swing.WindowConstants吗?
为什么还会有警告错误?