Question: ere is your exercise result and feedback: Sorry, incorrect! Expected ';' Your Code ( with color highlights added ): WereWolf enemyobject = new WereWolf(); set_xcoords(586);

ere is your exercise result and feedback: Sorry, incorrect! Expected ';' Your Code ( with color highlights added ): WereWolf enemyobject = new WereWolf(); set_xcoords(586); set_attackmode(4); value = get_xcoords ( ); The Instructions: Exercise 6.2: Inheritance and Objects Create an object from the child class and assign to a variable named enemyobject Call the 'set' method of the parent class and pass it the value 586 Call the 'set' method of the child class and pass it the value 4 Call the 'get' method of the parent class and assign the return value to a variable named value 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 { private int xcoords, ycoords; public void set_xcoords(int x) { xcoords = x; } public int get_xcoords ( ) { return xcoords; } } public class WereWolf extends Enemy { private int attackmode; public void set_attackmode(int am) { attackmode = am; } public int get_attackmode ( ) { return attackmode; } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!