You can throw your own exceptions and errors.
There are the checked exceptions which have to be handeled either with thows or with try/catch and the unckecked excetpions (RuntimeExcpeption and its subclasses). It is possible to throw an own Error as the following code shows.
In this case there isn't thrown an Exception but an Error. I somewhere read, there would be thrown a Throwable, i.e. a Superclass of Error? Is that true?
Docendo discimus (we learn by teaching)
SCJP 5 Zertifizierung, Vorbereitungsbuch; SCJP 6 Zertifizierung, Vorbereitungsbuch