Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

throw IllegalElementException

Status
Not open for further replies.

markgrizzle

Programmer
Aug 3, 2003
288
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top