Question: In main method create a words arrayList and add the following string values into it. Values: soccer, baseball, football, hockey, basketball At the end, call

In main method create a words arrayList and add the following string values into it.

Values: soccer, baseball, football, hockey, basketball

At the end, call test method inside the main method then

print words arraylist in console

test() method will take an argument of String ArrayLists called words, and then set the 0th and 2nd indexes to be "git" and "gud" respectively.

------------------

import java.util.*;

class Main {

//your main method code here by creating the ArrayList named "words" public static void main(String[] args) { //Create Your words ArrayList Here

System.out.println(words); test(words); System.out.println(words); }

public static void test(ArrayList words) { //write code here

} }

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!