I'm having trouble understanding this interface problem. I'm supposed to create a Word class with methods getFirst() to return the first character, getLast() to return the last character, getSequence() to return an arraylist of all the characters, and getPosition() should return the int representing the Word's position in the sentence.
I get an error message on the "OrderedThing" parameter (OrderedThing cannot be resolved to a type) - what do I do in the Word class that will solve this? I'm confused on what "OrderedThing" is (type? parameter?)
import java.util.ArrayList;
public interface SequentiallyOrdered {
public OrderedThing getFirst();
public OrderedThing getLast();
public ArrayList<OrderedThing> getSequence();
}
Thanks in advance
OrderedThingis a class that is being used as a return type for your abstract methods. Can you post yourWordclass?OrderedThing, and why aren't you returningCharacter? Is your interface supposed to be generic?