Write a method that continuously reads words from a user until the word entered is “done” and stores each word spelled backwards in an ArrayList in the order they were entered.

This is the code I have so far but whenever I try to call it in my main class it keeps failing. Can someone please help me? I have included both the class in which I am creating my method and the main class in which it is called. I cannot combine these two classes so I need to be able to call the object from todo in my main class. Thanks in advance! 

Sample input: banana racecar puppy done
Resulting ArrayList: ananab racecar yppup

```
import java.util.Scanner;
import java.util.ArrayList; 

public class todo extends main{

    public ArrayList <String>storeBackwards (Scanner keyboard) {
        ArrayList<String> words=new ArrayList (); 
        ArrayList<String> backwards=new ArrayList(); 

        String input=keyboard.next();
        while(!input.equalsIgnoreCase("done")) {
            words.add(input); 
            String get=""; 
            String back=""; 
            for(int i=0; i<words.size();++i) {
                get=words.get(i);
                for(i=get.length()-1; i>=0; i--) {
                    back=back+get.charAt(i); }
                backwards.add(back);
                }

            }
        return backwards;

        }
    }

```

This is the main class

```
import java.util.Scanner;
public class main {

public static void main(String[] args) {
    Scanner keyboard=new Scanner(System.in); 
    todo x=new todo(); 

    x.storeBackwards(keyboard);

}

}

```