Hi all,
I wondering how to get started with this. I am working on a method that will take two ints. These ints represent positions in an arraylist of characters. I am trying to determine if the elements of the two positions are equal. If, so display the elements, if not display the int position. For example f the arraylist is as follows:
ArrayList<Character> list = new ArrayList<Character>();
list.add('a');
list.add('f');
list.add('c');
list.add('a');
list.add('s');
and the method is:
public void matchElements(int charA, int char)
{
//(psuedocode)
if(list.get(charA).compareTo(list.get(charB) == 0)
display charA and charB
else
display position of charA and charB
}
Any suggestions will be greately appreciated.
Thanks,
Kimjack