user2938704
user2938704

Reputation:

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:

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

Upvotes: 0

Views: 580

Answers (1)

4J41
4J41

Reputation: 5095

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

Upvotes: 2

Related Questions