Home Ask Login Register

Developers Planet

Your answer is one click away!

kylejustinward February 2016

Why can't I get both class when I run my program in Eclipse?

I am trying to run my program with both classes used. However when I run my program it does't allow me to select my Player class (as you can see in the image below). How do I fix this? Thank you for your time and help!

enter image description here


Squiggly Muffin Man February 2016

All is good and working with Eclipse; it looks as it should. The Save and Launch dialogue simply means that you've already saved your player class, so there's no need to "re-save" it. Your Main class has been modified, and therefore needs to be "re-saved". However, if you've checked this, make sure that you have an instance of your Player class in your Main class! If you're unsure what this means, look at the code below:

Player player = new Player();

private Player player;
player = new Player();

Player player;
player = new Player();

If you've done that, but the code still isn't working, make sure you're calling the method createPlayer() from your instance.

If you've made sure you have that in it, I really can't find where the problem is.

Post Status

Asked in February 2016
Viewed 3,215 times
Voted 4
Answered 1 times


Leave an answer

Quote of the day: live life