I have a string like this
String[] tokens = {"Word0", "Word1","Word3"};
and then I have an arraylist like this
List<String> a = new ArrayList();
a.add("This will not change");
What I want to do is to be able to create a new arraylist ,b ,that puts these two together such that: Element 0 of b is "Word0 This will not change" Element 1 of b is "Word0 Word1 This will not change" Element 3 of b is "Word0 Word1 Word3 This will not change"
I played around with for loops and tried to somehow concatenate the strings but I couldn't figure it out.
"I played around with for loops and tried to somehow concatenate the strings but I couldn't figure it out."-- consider showing us your attempts. It will help us understand what you may be doing wrong, and gain you a little bit of respect for showing your efforts.new ArrayList();tonew ArrayList<>();; raw types are so last millennium.