Eclipse complains about my catch statement below
public class NaturalLanguageMultiply
{
public class WrongMultiplierException extends Exception
{
}
private static int toInt( String number ) throws WrongMultiplierException
{
// removed for clarity
try
{
String numberKey = scanner.next();
if ( numberMap.containsKey( numberKey ) )
{
multiplier += ( Integer ) numberMap.get( numberKey );
}
else
{
throw new WrongMultiplierException();
}
}
It complains about the following catch line:
Syntax error on tokens
catch ( WrongMultiplierException );
{
}
}
Also, why does StackOverflow keep asking:Your post does not have much context to explain the code sections; please explain your scenario more clearly. I cannot find the answer in the FAQ or Help.
to