我试图让我的.jar文件在我的dist文件夹中运行但是它没有运行,我试图清理并构建并注意到它正在发出消息:
Note: E:\ZombieDefense\src\GameScreen\ZombieDefense.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
经过一番搜索,我读到可能是在这个类中声明了我的一些变量?
无论如何我无法找到问题,想到也许有人可以看到它,谢谢
public class ZombieDefense extends JComponent implements Runnable {
//private Zombie zombie = new Zombie(this);
private ImageIcon background = new ImageIcon(getClass().getResource("background.jpg"));
protected Survivor survivor = new Survivor();
private Barricade barricade = new Barricade();
private GameScreen framePointer;
protected ArrayList<Zombie> zombieArray = new ArrayList();
protected ArrayList<Bullet> bulletArray = new ArrayList();
Scanner in = new Scanner(System.in);
Random random = new Random();
Thread timer = new Thread(this);
int currzomb = 0;
int maxzomb = 10;
int wave = 1;
int kills = 0;
int totalzomb = 10;
int threadint = 2000;
String name;
Stopwatch time;
如果是关于声明以外的其他内容让我知道,我将编辑并弹出代码,再次感谢
答案 0 :(得分:2)
protected ArrayList<Zombie> zombieArray = new ArrayList<Zombie>();
protected ArrayList<Bullet> bulletArray = new ArrayList<Bullet>();