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. And please please please, DO NOT write classes or declare variables.

Exercise 6.2: Inheritance and Objects Create an object from the child class and assign to a variable named theenemy Call the \'se method of the parent class and pass it the value 437 Call the \'set\' method of the child class and pass it the value 5 . Call the \'get method of the parent class and assign the return value to a variable named current · You do not have to write classes or declare variables, I will do that. Just create an object instance and call the methods. public class Enemy public class PitBull extends Enemy public class PitBull extends Enemy { private int attackmode; private int xposition, yposition; public void set_xposition(int x)f public void set_attackmode (int am) ( et-position (int x){ xpositionx; ; attackmode = am; public int get_xposition public int get_attackmode return attackmode; return xposition;

Solution

a) PitBull theenemy=new PitBull();

b) theenemy.set_xposition(437);

c) theenemy.set_attackmode(5);

d) int current=theenemy.get_xposition();

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

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site