I need help with this basic program. My friend had given me most of this code but not the import statements. Towards the end where it says list.add(finalCombined.get(counter3));
, it gives me an error. The error I get is
Cannot find Symbol
Symbol: variable list
location: class ArrayUtils
I'm very confused at this. I added which import statements I think I need. Thank you
import java.util.ArrayList;
import java.util.Random;
import java.util.Collections;
import java.lang.String;
public class ArrayUtils {
public void randomStrings(ArrayList<String> arrayList,int nbrOfStrings,int vowelCnt, int strSize){
ArrayList <String> finalCombined = new ArrayList();
ArrayList <String> finalCombined = new ArrayList();
for (int cnt = 0; cnt < nbrOfStrings; cnt++)
{
int cnt2 = 0;
int gn, size, vowelUsed;
Random n1 = new Random();
size = 122-96;
//char cs[] = new char[strSize];
//String cs;
//cs = "";
ArrayList <Character> cs = new ArrayList();
int counter = 0;
vowelUsed = 0;
while (counter < 1)
{
vowelUsed = n1.nextInt(vowelCnt + 1);
if (vowelUsed == 0)
{
}
else
{
counter = 2;
}
}
while (cnt2 < (strSize - vowelUsed))
{
gn = n1.nextInt(size) + 97;
if (gn == 97 | gn == 101 | gn == 105 | gn == 111 | gn == 117 | gn == 121)
{
}
else
{
cs.add((char)gn);
//cs += ((char)gn + "");
cnt2 ++;
}
}
while (cnt2 < strSize)
{
gn = n1.nextInt(size) + 97;
if (gn == 97 | gn == 101 | gn == 105 | gn == 111 | gn == 117 | gn == 121)
{
cs.add((char)gn);
//cs += ((char)gn + "");
cnt2 ++;
}
}
//int check;
//check = list.add(cs[cnt]);
Collections.shuffle(cs);
String combined;
combined = "";
//System.out.println(cs);
int counter2 = 0;
while (counter2 < strSize)
{
combined += cs.get(counter2);
counter2 ++;
}
finalCombined.add(combined);
counter2 = 0;
combined = "";
} // end # strings
for (int counter3 = 0; counter3 < nbrOfStrings; counter3++)
{
list.add(finalCombined.get(counter3));
}
} // end method
}