0

Hi. If given an arraylist in an interface like this:

interface Dictionary {
	public boolean hasWord(String word);
	public ArrayList<String> suggestions( String word );
	public void addWord( String word );
	
}

How do I use it?
If I try to use it as a normal arraylist, I get the error that the class implementing the interface is "not abstract and does not override abstract method suggestions(java.lang.String) in Dictionary"
How do I use it?

3
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by stultuske
0

So I need to do both this:

ArrayList suggestions = new ArrayList();

and this:

public ArrayList<String> suggestions( String word )
	{
		
		return suggestions;
	}

?

0

So I need to do both this:

ArrayList suggestions = new ArrayList();

and this:

public ArrayList<String> suggestions( String word )
	{
		
		return suggestions;
	}

?

when implementing an interface, you need to implement all of it's methods.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.