title: JAVA: error: unexpected type
body: <pre><code>public abstract class Character{
  
  public enum Type{ ROGUE, PALADIN, JACKIE_CHEN, SKELETON, GOBLIN, WIZARD}
  
  private String name;
  private int hitPoints;
  private int strength;
  private Weapon weapon;
  //other attributes
  
  //methods
  
  public Character(Type characterType){
      switch(characterType){
          case ROGUE:
              //set the attributes for a Rogue
              name = "Rogue";
              // TODO: set other attributes
              hitPoints = 55;
              strength = 8;
              Weapon rogue = new Weapon("Short Sword", 1, 4);
  
              break;
          case PALADIN:
              //set the attributes for a Rogue
              name = "Paladin";
              // TODO: set other attributes
              hitPoints = 35;
              strength = 14;
              Weapon paladin = new Weapon("Long Sword",3,7);
              break;
          case JACKIE_CHEN:
              name = "Jackie Chen";
              hitPoints =45;
              strength = 10;
              Weapon jackie = new Weapon("Jump Kick",2, 6);
              break;
          case SKELETON:
              name = "Skeleton";
              hitPoints = 25;
              strength = 3;
              Weapon skeleton = new Weapon("Short Sword" ,1, 4);
              break;
          case GOBLIN:
              name = "Goblin";
              hitPoints = 25;
              strength = 4;
              Weapon goblin = new Weapon("Axe",2,6);
              break;
          case WIZARD:
              name = "Wizard";
              hitPoints = 40;
              strength = 8;
              Weapon wizard = new Weapon("Fire Blast", 4, 10);
              break;
      }
  }
  
  public String getName(){
      return name;
  }
  
  public int getHitPoints(){
      return hitPoints;
  }
  public int getStrength(){
      return strength;
  }
  public void setStrength(int _strength){
      this.strength =_strength;
  }
  public void setWeapon(Weapon _weapon){
      this.weapon = _weapon;
  
  }
  
  public void attack(){
  
  }
  
  public void increaseHitPoints(){
  
  }
  public void decreaseHitPoints(){
  
  }
  /*public boolean isDefeated(){
  
  }*/
  </code></pre>
  
  <p>}</p>
  
  <pre><code>import java.util.Scanner;
  import java.util.Random;
  public class Player extends Character{
  // attributes for the plauer class
  // initilizes the fields
  private int coins;
  private Potion[] inventory;
  Random randomNums = new Random();
  Scanner keyboard = new Scanner(System.in);
  
  //methods
  
  public Player(Type playerType){
      super(playerType);
      coins = 0;
      inventory = new Potion[5];
  }   
  
  public void increaseStrength(int strengthIncrease){
      enemy.getHitPoints() -= playerATK;
  
  
  }
  public int getCoins(){
      return coins;
  }
  public void increaseCoins(int coins){
  
  }
  public void decreaseCoins(int coins){
  
  }
  public void addToInventory(String a, Type potion){
  
  }
  public void removeFromInventory(int index){
  
  }
  public void displayInventory(){
  
  }
  /*public int getNumOpenSlots(){
      return numOpenSlots;
  }*/
  
  public void battleMinion(Enemy enemy){
  
  
      Enemy goblin = new Enemy(Character.Type.GOBLIN);
      int playerDamage =0, playerATK =0, enemyATK =0, enemyDamage =0;
  
      if (enemy.getName() == "Goblin" &amp;&amp; getName()=="Rogue"){
          for (int i = 1; i &lt;= goblin.getNumGoblins(); i++)
          {
            System.out.printf("***%s vs %s %d***\n", getName(), enemy.getName(), i);
  
            while(enemy.getHitPoints() &gt; 0 &amp;&amp; getHitPoints() &gt; 0)
            {
              playerDamage = randomNums.nextInt(Weapon.SHORT_SWORD_MAX - Weapon.SHORT_SWORD_MIN + 1) + Weapon.SHORT_SWORD_MIN;
              playerATK = getStrength() + playerDamage;
              enemy.getHitPoints() -= playerATK;
              System.out.printf("%s attacks with ATK = %d + %d = %d\n", getName(), getStrength(), playerDamage, playerATK);
              System.out.printf("%s HP is now %d - %d = %d\n\n", enemy.getName(), enemy.getHitPoints() + playerATK, playerATK, enemy.getHitPoints());
  
              if (enemy.getHitPoints() &lt;= 0)
                break;
  
              enemyDamage = randomNums.nextInt(Weapon.AXE_MAX - Weapon.AXE_MIN + 1) + Weapon.AXE_MAX;
              enemyATK = enemy.getStrength() + enemyDamage;
              getHitPoints() -= enemyATK;
              System.out.printf("%s attacks with ATK = %d + %d = %d\n", getName(), enemy.getStrength(), enemyDamage, enemyATK);
              System.out.printf("%s HP is now %d - %d = %d\n\n", getName(), getHitPoints() + enemyATK, enemyATK, getHitPoints());
            } // end of while loop
  
            if (getHitPoints() &gt; 0){
              System.out.printf("%s defeated %s %d!\n\n", getName(), enemy.getName(), i);
              coins = randomNums.nextInt((50 - 30) + 1) + 30;
              System.out.println(getName() + " gains " + coins + " gold coins!\n");
              //player[4] += coins;
            }
            else
            {
              System.out.printf("--%s is defeated in battle!--\n\nGAME OVER\n", getName());
              System.exit(0);
            }
  
            if(i &lt;= goblin.getNumGoblins() - 1){
              System.out.println("Press enter to continue...");
              keyboard.nextLine(); 
            }
          }
      }
  </code></pre>
  
  <p>Error is as follows</p>
  
  <blockquote>
    <p>./Player.java:59: error: unexpected type
                        enemy.getHitPoints() -= playerATK;
                                          ^
          required: variable
          found:    value
        ./Player.java:68: error: unexpected type
                        getHitPoints() -= enemyATK;</p>
  </blockquote>
  
  <p>I know this is wrong, but what is the reason behind this? Also I have </p>
  
  <pre><code>public void increaseHitPoints(){
  
  }
  public void decreaseHitPoints(){
  
  }
  </code></pre>
  
  <p>these two class in my character class, I don't how to code to make this work.</p>