Question : How to remove all Strings in rayList that end with the same Last Letter as lastLetter?
I write my code like this so i remove all string from ArrayList that has same end character as lastLetter
import java.util.*;
public class LastLetter
{
  public static ArrayList<String> go(ArrayList<String> rayList, char lastLetter)
  {
    ArrayList<String> result = new ArrayList<String>();
    for(int i = 0; i<rayList.size(); i++)
    {
      char last = rayList.set(i, rayList.get(raylist.size() - 1));
      if(lastLetter == last)
       result.add(rayList.remove(i));
    }
  return result;
  }
}
I do not know if it is working or not and i do not understand how to make runner for this code please correct any problems from my code and make a runner so we can run this code properly.
My try to make runner:
import java.util.*;
class Runner 
{
  public static void main(String[] args) 
  {
    ArrayList<String> list = new ArrayList<String>();
    list.add("fred");
        list.add("at");
        list.add("apple");
        list.add("axe");
        list.add("bird");
        list.add("dog");
        list.add("kitten");
        list.add("alligator");
        list.add("chicken");
    LastLetter h = new LastLetter();
    System.out.println(h.go(list),"m");
  }
}
Please make a proper runner for this code.
Thank you
 
    