I'm a newbie at Java programming and its just not coming together for me like other languages I've learned.
So hopefully someone here can help.![:)]()
I need to build an Exception class that contains a static public array of valid answers and from this I need to determine if the answer given is valid and if not I will throw the exception.
I tried coding the exception class a few different ways but when I try to code something before super(answer) it gives me an error.
How do I incorporate an array into an exception class?
Any help would be greatly appreciated.
public clase MainException extends Exception
{
public MainException(String answer)
{
**I get an error here if I add anything to test the answer given saying the super("Answer given was incorrect") needs to be first**
super("Answer given was incorrect");
}
{
Thanks.
Nikki
So hopefully someone here can help.

I need to build an Exception class that contains a static public array of valid answers and from this I need to determine if the answer given is valid and if not I will throw the exception.
I tried coding the exception class a few different ways but when I try to code something before super(answer) it gives me an error.
How do I incorporate an array into an exception class?
Any help would be greatly appreciated.
public clase MainException extends Exception
{
public MainException(String answer)
{
**I get an error here if I add anything to test the answer given saying the super("Answer given was incorrect") needs to be first**
super("Answer given was incorrect");
}
{
Thanks.
Nikki