Exercises, examples and other material relating to training module J712. This topic is presented on public courses Learning to Program in Java
, Java Bootcamp
, Java Programming for the Web
Your program is affected by the environment around it. Its performance will vary depending on aspects as diverse as user inputs and the availability (or lack) of a network service. Java provides you with exceptions, which are a mechanism through which you trap and handle behaviours that differ from the norm.
Related technical and longer articleserrors v exceptions
|Articles and tips on this subject||updated|
|3045||After Course Resources - do we publish sample answers. Example from Java Exceptions module.|
At the end of each module on our courses, there's an exercise for the delegates. It lets them make use of many of the elements they've learned about to consolidate their knowledge. And it helps me evaluate, as they work through the exercise, how they are progressing; I can "mop up" any major elements ...
|3048||String handling - from first steps to practical examples|
Initial String handling examples on a training course are sometimes a bit mundane - and that's because we have to cover some of the basics like "what is a string" before we start reading them in useful quantities from files, databases, or web resources. But it's important to get those basics understood ...
|2862||Fail Safe Error Handling in Java via Exceptions|
"What could possibly go wrong?" ... The usual answer from a cynic is "anything, and usually at the most inconvenient time, and in the most unexpected way!". So checking for routine errors in your program code is a good start, but it doesn't go far enough; you need to be able to handle errors which are ...
|2622||Handling unusual and error conditions - exceptions|
"I can't answer that question in the way you expect" ... that's something that may be said to you occasionally - you ask someone what suit a playing card is that they're holding and they cannot tell you because it is a joker, or you ask what number is written on a piece of paper when the paper is blank.
|2420||Exceptions in Java - why and how|
Although it's common practise to include a static main test program in a class, it's something that newcomers can have some difficulty following ... so we don't do it too early on the course - we keep classes and programs that use those classes (even if they are just test programs) each in their own ...
|1875||What are exceptions - Python based answer|
How do you check for run time errors in your program? You'll include tests with if statements in almost every program you write, to ensure that user entered data is reasonable / as you would expect ... but you will also need to do more that that. You'll need to check whether a system function has run ...
|1066||Final, Finally and Finalize - three special words in Java|
A final method or variable is one that can't be overridden - you can define a method as final within a class to ensure that any extensions to the class don't replace it.
If you add a finally block onto the end of a try / catch exception handler, you're defining a block of code that will be run if the ...
Examples from our training material
This module is available under an Open Training Notes License
for free download from http://www.training-notes.co.uk
Topics covered in this module
"trying" and "catching".
Defining your own exceptions.
If you are looking for a complete course and not just a information on a single subject, visit our Listing and schedule
Well House Consultants specialise in training courses in
. We run
throughout the UK (and beyond for longer courses), and
at our training centre in Melksham, Wiltshire, England.
It's surprisingly cost effective to come on our public courses -
even if you live in a different
country or continent to us
We have a technical library of over 700 books on the subjects on which we teach.
These books are available for reference at our training centre. Also
available is the Opentalk
Forum for discussion of technical questions.