I'm supposed to write a program that
1)has an array of Strings that is then added to a List -and outputting that List
2)remove certain Strings in List1 by using a second List -and outputting the result
3)and finally, reverse the order of the Strings outputted in the last result
Problem: Eclipse is telling me that I have not imported the correct method for this program and the output is an error
.
After this, I imported the suggested import that Eclipse gave me, with the result being that I only outputted 1)and2) as a single line
What am I missing?
(Note: the "problem method" is ListIterator (all the way at bottom ListIterator<
String> william = L.listIterator(L.size());
eclipse says "ListIterator cannot be resolved to a type"
and suggests (among other things) I import ListIterator.util (but doing so outputs 1)and 2) as a single line)
UPDATE: after going over the code yet again, I realized that what I thought was the problem was actually something else entirely. In case you're wondering (and because I think learning from my experience
could help someone in a similar situation): one of the pieces of code that I wrote was in fact an obsolete piece of code that I somehow copied to this class.
in addition, this piece of code resulted in an output similar to what I was looking for -in regards to the program as a whole.(the code removed certain String words from a List by using another List
-meanwhile, I was trying to remove certain words from that same List via another technique (just fyi: I also incorrectly construed my second goal ("2) above")
The Fix: I removed the obsolete code, and then proceeded to and succeeded in fixing the code with the correct "method"