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!
server_crash 64 Postaholic
Recommended Answers
Jump to PostThink of calling a method to do a database query on a database that is closed.
Or calling a read method on a stream that's past the end of the data.
Or calling write methods on a readonly file.Note that these won't throw IllegalStateException in Java but they …
Jump to PostIt is. But remember File et.al. typically throw IOExceptions which don't derive from IllegalStateException.
IllegalStateException is a RuntimeException, which is why you'll find few cases of it being explicitly caught (usually these are used to indicate programming errors rather than runtime problems, despite what their name suggests) while IOException …
All 7 Replies
starsunited 1 Light Poster
server_crash 64 Postaholic
jwenting 1,905 duckman Team Colleague
server_crash 64 Postaholic
jwenting 1,905 duckman Team Colleague
server_crash 64 Postaholic
GoogleException 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.