Hey guys, i've been trying to clone pokemon in java but i've come across a very weird problem.

java.lang.VerifyError: (class: attribute/base/health/AbstractBaseHealth, method: <init> signature: ()V) Constructor must call super() or this()
	at actor.pokemon.AbstractPokemon.<init>(AbstractPokemon.java:44)
	at actor.pokemon.charmander.AbstractCharmander.<init>(AbstractCharmander.java:16)
	at actor.pokemon.charmander.ConcreteCharmander.<init>(ConcreteCharmander.java:11)
	at main.Main.<clinit>(Main.java:17)
Could not find the main class: main.Main.  Program will exit.
Exception in thread "main" Java Result: 1

apparently there's a problem with my AbstractBaseHealth class, however, the weird thing is that the code for AbstractBaseAttack and others are EXACTLY the same, and yet they work just fine, let me show you the code for Health Hierarchy.

public interface BaseHealth 
    extends Base
{
    
}

public abstract class AbstractBaseHealth 
    implements BaseHealth
{
    private int baseHealth;
    
    @Override
    public void set(Object value) {
        baseHealth = (int)baseHealth;
    }

    @Override
    public Object get() {
        return baseHealth;
    }
}

public class ConcreteBaseHealth 
    extends AbstractBaseHealth
    implements BaseHealth
{
    
}

i commented out the basehealth attribute from the pokemon class (and let the base attack and such) and it worked just fine... any idea guys? thanks in advance.

wow, i just read over my own post and saw the problem, in line 14 i went (int)baseHealth instead of (int)value.... sorry guys.

still, it's weird how the same problem existed in the other classes yet there were no complains.

move on, nothing to see here!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.