Creating a return statement
I'm trying to create a return statement with all of my conditions, but I cannot figure out how to do it properly.
My plan is that once a condition is met, the method will return that condition.
For example:
if the "o" matches the condition, the method would have to return "o"
Here's my code.
public Actor createActor(char c)throws UnknownActorException
{
if(c != ('*'))
thrownew UnknownActorException("Cannot be an asterisk");
if(c != (' '))
thrownew UnknownActorException("Cannot have a space");
if(c != ('-'))
thrownew UnknownActorException("Cannot have a space");
if(c != ('o'))
thrownew UnknownActorException("Cannot have a space");
}

