I'm trying to go thru the SCJP book and also the Sun exam objectives and organize some notes on the subject of exceptions. All the exceptions listed in the objectives seem to be unchecked exceptions (they are subclasses of RuntimeException or Error). I see nothing listed on direct subclasses of Exception, so I'm wondering which checked exceptions were are supposed to know for the exam. Can anyone help or refer me to some notes on exceptions?
from Sun: "Understand which of these are thrown by the virtual machine and recognize situations in which others should be thrown programatically." I've read the section on this in K&B, and am still fuzzy on the concept, if someone could provide some clarity I'd appreciate that.
The checked exceptions that you should know about for the exam are basically the ones that are part of the API covered in the exam.
For example, since the exam covers I/O, it is imperative that you should know about IOException and FileNotFoundException. Or Thread.sleep -> InterruptedException.
In general, we haven't seen anybody getting a question that required specific knowlegde of any particular exception (except the ones listed in objectives).
Understanding of exceptions is important for determining correct method overriding, try/catch rules, and general program control flow. If a question is testing you on overriding, it will be clear enough for you to know that the base class method is throwing a checked exception. So if you understand that, you don't really need to worry about actual exception classes.
There is a table in the K&B on pg 370. the exceptions listed there you will be explicitly tested on. for ex: they could have a question that accesses a bad array index and ask you what kind of exception will be throw. Then there are some topics where you will be implictly be tested on. In these questions you will just need to look if its been given a try/catch. these are:
1.)whenever you see a file question, 2.) a serialization question, 3.)In threads a JWS question. JWS being a join, wait or sleep. 4.)parsing using dateformat or numberformat. All the above throw checked exceptions. Ofcourse you know about assertion errors.