Question: This task requires and array of 26 indexes. Each array index needs to hold an array list containing strings. For example when I read in
This task requires and array of 26 indexes. Each array index needs to hold an array list containing strings. For example when I read in a file I will be able to put all the words that start with character a in the arrayList held in index 0 of the array words that start with character b will go into the arrayList held at index 1 and so on all the way to z. Some of the commented lines ar just where I have been trying different approaches. Thanks for any help!
package mylinkedlist;
import java.io.*; import java.util.*; public class MyLinkedList {
public static void main(String[] args) throws Exception{ MyLinkedList[] list = new MyLinkedList[25]; for (int i = 0; i < list.length; i ++) { list[i] = new ArrayList<>(); } //String[] array = new String[26]; //List
} }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
