Ok, I think I know how abstract classes work… but maybe not? I have an abstract class called entity that has an abstract kill method…
/**
* Kills the this entity.
*/
public abstract void kill();
and I override that method in a sub class called Zombie and another called Player…
/**
* Kills the player.
*/
@Override
public void kill() {
System.err.println("PLAYER KILLED");//Test test test :(
}
However the console spits out this…
java.lang.ExceptionInInitializerError
at mygame.Main.simpleInitApp(Main.java:124)
at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:220)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:130)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:211)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: Uncompilable source code - mygame.Player is not abstract and does not override abstract method kill() in mygame.Entity
at mygame.InteractiveObject.<clinit>(InteractiveObject.java:19)
... 5 more
Also InteractveObject (super class of entity) line 19 is just this line…
float mass = 1f;
I have no idea what is going on here. My abstract entity class was working fine with one abstract method but I added in another and it just freaked out. I even tried doing a clean build. I really hope someone knows whats going on here. Until I find out whats wrong I’ll just change entity class to be non abstract and just override the empty methods.