Jon
Jon Camilleri wrote:1. Is there some reference where I can lookup existing exceptions? The API s***s sometimes
2. Specifically does anyone know of an existing exception that caters for 'Invalid Cast'?
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Prime wrote:What's wrong with plain old java.lang.ClassCastException? It will be thrown automatically if a cast fails.
Jon Camilleri wrote:1. Is there some reference where I can lookup existing exceptions? The API s***s sometimes
At the top, click Tree. Look for java.lang.Throwable. Check out the reeeeaaaaally big list of exceptions available
Also, the most used exceptions are in packages java.lang, java.io and java.util. Open those package and scroll to the bottom. There are separate sections for exceptions and errors.
2. Specifically does anyone know of an existing exception that caters for 'Invalid Cast'?
See my first line.
Jon
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Jon
Rob Prime wrote:
At the top, click Tree. Look for java.lang.Throwable. Check out the reeeeaaaaally big list of exceptions available
Also, the most used exceptions are in packages java.lang, java.io and java.util. Open those package and scroll to the bottom. There are separate sections for exceptions and errors.
What long list?
Jon
You shouldn't use underscores for either.David Newton wrote:Do you use leading underscores for both locals *and* members?
David Newton wrote:@Rob:Do you use leading underscores for both locals *and* members?
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |