I'm assuming your direct question (can static be inherited) has been answered.
I thought I'd suggest an alternate approach:
From your question I assume you want to avoid adding 4 bytes to each instance with their unique attackvalue, as each warrior has 50 attack, it should be 1 place that lists this.
This solution will still cost 4 bytes in case of 1 number but will be more optimal in the case of more than 1 of these numbers.
class Army {
private final ArmyConfiguration configuration;
public Army() {
this("Army");
}
public Army(String configurationName) {
this.configuration = ConfigFactory.getInstance().getConfiguration(configurationName)
}
public ArmyConfiguration getArmyConfiguration() { return configuration; }
}
class Warrior {
super("Warrior");
}
class Archer {
super("Archer");
}
class ConfigFactory {
private static ConfigFactory instance;
public synchronized ConfigFactory getInstance() {
if (instance == null) {
instance = new ConfigFactory();
}
return instance;
}
private Map<Class, ArmyConfiguration> configMap;
public ConfigFactory() {
this.configMap = new HashMap<Class, ArmyConfiguration>();
configMap.put("Army", new ArmyConfiguration(0));
configMap.put("Warrior", new ArmyConfiguration(50));
configMap.put("Archer", new ArmyConfiguration(75));
}
public ArmyConfiguration getConfiguration(String name) {
return configMap.get(name);
}
}
class ArmyConfiguration {
public final int attackValue;
public ArmyConfiguration(final int attackValue) {
this.attackValue = attackValue;
}
}
Ofcourse this isn't ideal (singleton might not be what you want). This setup would let you load the config from disk without havign to recompile things. (during the ConfigFactory constructor, load file from disk, parse it and construct the instances)
This way you separate the actual settings / configuration of the objects from the logic those objects need. For smallscale stuff, hardcoding is an option, for larger projects you may want to extract.