Home Accessibility Courses Twitter The Mouth Facebook Resources Site Map About Us Contact
 
Python, Lua and Tcl - public course schedule [here]
Private courses on your site - see [here]
Please ask about maintenance training for Perl, PHP, Java, C, C++, Ruby, MySQL and Linux / Tomcat systems
 

Well House Consultants
You are on the site of Well House Consultants who provide Open Source Training Courses and business hotel accommodation. You are welcome to browse and use our resources subject to our copyright statement and to add in links from your pages to ours.
Other subject areas - resources
Java Resources
Well House Manor Resources
Perl Resources
Python Resources
PHP Resources
Object Orientation and General topics
MySQL Resources
Linux / LAMP / Tomcat Resources
Well House Consultants Resources
Extras Resources
C and C++ Resources
Ruby Resources
Tcl/Tk Resources
Web and Intranet Resources
Java module J712
Exceptions
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 articles
errors v exceptions

Articles and tips on this subjectupdated
4396Java Utility class - flexible replacement for array. Also cacheing in objects and multiple catch clauses example.
In Java, utility class objects are used as flexible alternatives to arrays to hold collections of other obejcts. ArrayLists and Vectors hold an ordered (indexed) set of other objects, but due to the structure used in memory, there's no need to know how many items there are going to be in the collection ...
2015-01-17
 
4350Keyboard reader for Java programming newcomers
I've added a new class of Keyboard Reader for our Java courses [here], for the earlier examples and exercises just after "Hello World". We want to be able to teach people to write a read - calculate - write program early on, but Java inputs require exception handling, and exceptions are objects, and ...
2014-12-11
 
3045After 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 ...
2010-11-13
(longest)
3048String 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 ...
2010-11-13
 
2862Fail 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 ...
2010-07-09
 
2622Handling 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. The ...
2010-02-03
 
2420Exceptions 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 ...
2009-09-25
 
1875What 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 ...
2008-11-08
 
1066Final, 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 ...
2007-02-05
 
Examples from our training material
Addbase.java   Exercise Base - make this user proof
Adder.java   Solution to Addbase exercise
Bikini.java   Practical Exception Handling Example
E1.java   Class to which to add exception handling during practicals
E1a.java   Sample answer - handling exceptions on reading use input
Jane.java   Define your own exception class
Keira.java   try, catch, finally - full example
KeyRead.java   Keyboard Read for use during early exercises
card_7.java   for neston demo - interface card
neston.java   First example of an exception
playing_card_7.java   class of playing_card, used in "neston"
suspect_card_7.java   class used within "neston" demonstration
wadswick.java   Sample program that will throw an exception, not catch it, and fail
Background information
Some modules are available for download as a sample of our material or under an Open Training Notes License for free download from [here].
Topics covered in this module
trying and catching.
throwing.
finally.
Defining your own exceptions.
Complete learning
If you are looking for a complete course and not just a information on a single subject, visit our Listing and schedule page.

Well House Consultants specialise in training courses in Java,Ruby, Lua, Python, Perl, PHP, and MySQL. We run Private Courses throughout the UK (and beyond for longer courses), and Public Courses 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.


You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2018: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01225 708225 • FAX: 01225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/resources/J712.html • PAGE BUILT: Mon Feb 8 18:55:24 2016 • BUILD SYSTEM: WomanWithCat