Question: In Java Programming Language 1) Assume a method that returns an array of Object called getAll(). Assume a List of an interface called InIn. Properly

In Java Programming LanguageIn Java Programming Language 1) Assume a method that returns an array

of Object called getAll(). Assume a List of an interface called InIn.

1) Assume a method that returns an array of Object called getAll(). Assume a List of an interface called InIn. Properly create an loop that will pull objects from getAll() and add them to the List of Inin. So, you can try the code below: List Ist = new ArrayList: Object() objs= getA110; for(int i=0;i player1, player2; Fighter is a class like: public class Fighter { This will ensure only InIn objects are added. Include code that will output the number of InIn objects added. To use this code you should: 1) Create the InIn interface with some method. 2) Create a class to implement the InIn interface. 3) Create the getAllMethod(). Include instances of the class created in step 2, along with other objects 2) Assume a computer game called Armies. Two players face off against each other. Each has a List of Fighter like: List player1, player2; Fighter is a class like: public class Fighter { public int hitPoints; //the amount of "life" the fighter has public Fighter(int hpX{ hitPoints = hp; } } Each list has a certain number of instances. For player l's turn, he launches a bomb at player 2. Every Fighter instance in playerl list will have its hitPoints reduced by a random number between 0 to 20. This is accomplished by passing the appropriate list to the following function: static void drop TheBomb(List li=army.listIterator(); while(li.hasNextOX Fighter f = li.next(); //This will randomly remove 0 - 20 hitpoints f.hitPoints - = (int)(Math.random()*21; } } Do NOT change this code. Populate both List

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!