Results 1 to 4 of 4

Thread: IllegalStateException?

  1. #1

    Thread Starter
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    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!

  2. #2
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418

    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.

  3. #3

    Thread Starter
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Re: IllegalStateException?

    Well, how can you call a method at an illegal time? And won't that throw different exceptions other than illegalStateException?

  4. #4
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418

    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
  •  



Click Here to Expand Forum to Full Width