markgrizzle
Programmer
Hi:
I'm studying Java in school and need some help. I mention that I'm studying it because I need to write the code myself, and so I guess I'm looking for an explanation more than anything else.
My project is to build a stack using an array. If the stack is popped and is empty, then the app should throw an IllegalElementException.
From my reading, I believe I need to create an IllegalElementException class, and extend the Exception class. My class constructor has no arguments.
When I try to reference this type in my pop() method, the compiler complains with "IllegalElementException cannot be resolved."
Can anyone point me in the right direction?
Thanks in advance
Mark
I'm studying Java in school and need some help. I mention that I'm studying it because I need to write the code myself, and so I guess I'm looking for an explanation more than anything else.
My project is to build a stack using an array. If the stack is popped and is empty, then the app should throw an IllegalElementException.
From my reading, I believe I need to create an IllegalElementException class, and extend the Exception class. My class constructor has no arguments.
When I try to reference this type in my pop() method, the compiler complains with "IllegalElementException cannot be resolved."
Can anyone point me in the right direction?
Thanks in advance
Mark