The instructions to answer my question are below in bulletpo

The instructions to answer my question are below in bulletpoints, and write the code in Java with comments. And please DO NOT write classes or declare variables.

Solution

public class Enemy {

   private int xposition, yposition;

   /**
   * @return the xposition
   */
   public int get_xposition() {
       return xposition;
   }

   /**
   * @param xposition
   * the xposition to set
   */
   public void set_xposition(int xposition) {
       this.xposition = xposition;
   }

}

public class PitBull extends Enemy {

   private int attackmode;

   /**
   * @return the attackmode
   */
   public int get_attackmode() {
       return attackmode;
   }

   /**
   * @param attackmode
   * the attackmode to set
   */
   public void set_attackmode(int attackmode) {
       this.attackmode = attackmode;
   }

}

public class TestEnemy {

   /**
   * @param args
   */
   public static void main(String[] args) {

       PitBull theenemy = new PitBull();
       theenemy.set_xposition(437);
       theenemy.set_attackmode(5);
       int current = theenemy.get_xposition();

   }
}

The instructions to answer my question are below in bulletpoints, and write the code in Java with comments. And please DO NOT write classes or declare variables

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site