Java Reference
In-Depth Information
Chapter 7
Application Improvements
In this chapter, we will add functions to not only make our application easier to use, but also decrease the chance of
“runtime” errors. For instance, we will begin using choice components to insure that only valid data is supplied to the
Java application. In addition, we will “catch” errors before the user sees them. Once an error is caught, the application
will either resolve the error or tell the user (in much clearer/simpler language than the JVM error messages) what the
problem is and how to solve it. We will also explain the concept of iteration (looping) and show how programmers
incorporate iteration to increase efficiency.
We will also introduce some new Java formatting classes that make displayed information easier to read,
understand, and produce and, finally, demonstrate a powerful Java technique: method overloading.
In this chapter, you will learn about:
Editing and auditing data
Formatting numeric, date, and time data
The StringBuffer class
Exceptions
try and catch keywords
The Choice class
Iteration (looping)
Method overloading
After this chapter, you should be able to:
Define, throw, and catch an exception
Create, populate, and read selected text from a Choice object
Define a loop
Control the format of numeric, date, and time data
Use and manipulate string buffers
 
Search WWH ::




Custom Search