Question: This is in JAVA Exercise 3.1: Linked Lists. Inheritance and Objects Create an object from the child class and assign to a variable named enemyobject
This is in JAVA
Exercise 3.1: Linked Lists. Inheritance and Objects Create an object from the child class and assign to a variable named enemyobject Create a second object from the child class and assign to a variable named enlink2 Call the inherited 'set' method of the first object and pass it the reference to the second object Call the inherited 'set' method of the second object and pass it the reference to the first object Congratulations! Your objects are now Linked! You do not have to write classes or declare variables, I will do that. Just create object instances and call the methods. public class Alink { private ALink next; public void setNext(ALink x) { next = x; } public Alink getNext() { return next; } } public class Swamp Thing extends Alink { private int attackmode; public void set_attackmode (int am) { attackmode = am; } public int get_attackmode () { return attackmode; } } Implement the instructions above by placing your Code here
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
