Reverse-indenting exception handling blocks.

Lab Notes
Clarifying exception handling
by Matt Brenner
Listing 5. Reverse-indenting exception handling blocks.


1 public static final double
2 todouble (String text)
3 {
4      double       val;
5
6
7           try {
8      val = Double.valueOf (text).doubleValue();
9           }
10         catch (NumberFormatException e) {
11             val = Double.NaN;
12         }
13
14    return (val);
15 }

Upcoming Training Events

0 AM
Visual Studio Live! San Diego
September 8-12, 2025
Live! 360 Orlando
November 16-21, 2025
Cloud & Containers Live! Orlando
November 16-21, 2025
Data Platform Live! Orlando
November 16-21, 2025
Visual Studio Live! Orlando
November 16-21, 2025