|
-
Apr 19th, 2005, 08:00 PM
#1
Thread Starter
Frenzied Member
IllegalStateException?
I've looked and looked for some good material on this exception, but I can't find anything helpful. I just don't understand it. It's suppose to be caught or thrown whenever a method is called when not suppose to be...But won't other exceptions be caught or thrown in it's place? If you have any comments or anything to say, please post!
-
Apr 20th, 2005, 08:50 PM
#2
Dazed Member
Re: IllegalStateException?
Signals that a method has been invoked at an illegal or inappropriate time.
Since it's a subclass of RuntimeException your not required to declare it in the throws clause. I guess you throw an IllegalStateException exception when, well a method is called an an illegal time.
-
Apr 21st, 2005, 05:04 AM
#3
Thread Starter
Frenzied Member
Re: IllegalStateException?
Well, how can you call a method at an illegal time? And won't that throw different exceptions other than illegalStateException?
-
Apr 21st, 2005, 09:20 PM
#4
Dazed Member
Re: IllegalStateException?
Posted by System Error
Well, how can you call a method at an illegal time?
Perhaps if an objects data must be accessed asynchronously. Without an absence of synchronism the object might be left in an inconsistent state. There is an IllegalThreadStateException though so i don't know if an IllegalStateException would apply to the above instance.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|