简体   繁体   English

class.java使用未经检查或不安全的操作

[英]class.java uses unchecked or unsafe operations

I am trying to get my .jar file running in my dist folder however it is not running, I have tried to clean and build and noticed that it is giving the message: 我试图让我的.jar文件在我的dist文件夹中运行但是它没有运行,我试图清理并构建并注意到它正在给出消息:

Note: E:\ZombieDefense\src\GameScreen\ZombieDefense.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

After some searching, I read that it may be to do with the declaration of some of my variables in this class? 经过一番搜索,我读到这可能与我在这个类中声明一些变量有关吗?

Anyway I am not able to find the problem and thought maybe someone here can see it, thank you 无论如何我无法找到问题,想到也许有人在这里可以看到它,谢谢

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;

If it is to do with something other than declaration let me know and I'll edit and pop the code on, thanks again 如果它与声明以外的其他内容让我知道,我将编辑并弹出代码,再次感谢

protected ArrayList<Zombie> zombieArray = new ArrayList<Zombie>();
protected ArrayList<Bullet> bulletArray = new ArrayList<Bullet>();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM