All exceptions are the results of two main problems :
1) Bad coding - doing something with a variable that you do not expect.
2) OS level errors that stop your code functioning correctly.
I don't really believe there are actually a difference between "expected and unexpected". If you are a programmer - you should never perform an operation that you do not fully understand the many threads of execution.
However, perhaps philosophically you could kind of distinguish.
For example, an "expected error" could be one such as an IOException when loading a file. Everyone knows that an IO exception could easily be thrown - so we all prepare for it.
However, what about parsing numbers ? If you have a String that is usually "1", this will parse using Integer.parseInt() easily. However, a common newbie mistake is to perform a parseInt() on a String that is "1.1". This will throw a NumberFormatException - an could be interpreted as being "unexpected".
But I don't really believe in this - its just a level of skill and knowing how to code correctly.
Now, one possible real "unexpected exception" is OutOfMemoryError - there is not a lot a java programmer can do to guard against failure to malloc space on the heap - because we don't work directly with heap allocation.
But mostly, no exception should be unexpected - and if it is, you need to code better !
--------------------------------------------------
Free Database Connection Pooling Software