Player Constructor wrote...
public Player(){
HealthBar playerHealth = new HealthBar("player");
getWorld().addObject(playerHealth, 175,25);
}Health Constructor wrote...
public HealthBar(String name){
type = name;
Img = name+"HealthBar01.png";
setImage(Img);