Replace the E in <E> with the data type that is going in the arraylist.
Why are you putting the array's into an ArrayList?
Type: Posts; User: Norm
Replace the E in <E> with the data type that is going in the arraylist.
Why are you putting the array's into an ArrayList?
What happens to the object returned by the first line?
Compile it and execute it to see. That's what I'd have to do.
See my post#21 for how to get/read elements in an array.
Use the elements from the array in String class methods.
You can access elements of an array by using an index:
theArray[theIndex] //<<< access element in theArray at theIndex
Can you explain what you mean by "read from the array"?
Use a while loop and exit the loop when there are no more lines to be read from the file.
The code in post#1 does that already.
See the tutorial about arrays:
Arrays (The Java™ Tutorials > Learning the Java Language > Language Basics)
Or look at the many code samples here on the forum.
If you have arrays of words to search for in lines read from a file, as each line is read from the file loop through the arrays and use the array elements in a String class's method to see if the...
Do some more research on how to use a Map. Your posting doesn't look like how a Map would be used.
How are the two arrays: faults and adaption going to be used?
How do you want to use arrays with Maps?
What is in the arrays?
What in the Map?
A Map sounds like a useful tool. The key to the Map would be the category and the value associated with that key could be an ArrayList of all the sentences that matched.