There are two things that I see that may be causing you problems. Here's the first one:
CODE
List<Character> theList = new ArrayList<Character>();
I know that ArrayList either extends or implements the List object, but I can't remember offhand. I would suggest creating the ArrayList like this regardless:
CODE
ArrayList<Character> theList = new ArrayList<Character>();
The other thing that I see is in your add method:
CODE
theList.add(aString.charAt(x));
You're adding a char to the array list, but it is supposed to take a Character object. Try this instead:
CODE
theList.add(new Character(aString.charAt(x)));
Try these two things and tell me how they work.
Good luck.
Edit:
You may also be declaring your ArrayList incorrectly. Try this:
CODE
ArrayList<Character> theList = new ArrayList();
Again, I'm not sure because I'm not a big fan of ArrayLists myself.
This post has been edited by keems21: 24 Apr, 2007 - 05:51 PM