diff options
Diffstat (limited to 'Master/Reference Architectures and Patterns/hjp5/examples/Listing1207.java')
| -rw-r--r-- | Master/Reference Architectures and Patterns/hjp5/examples/Listing1207.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Master/Reference Architectures and Patterns/hjp5/examples/Listing1207.java b/Master/Reference Architectures and Patterns/hjp5/examples/Listing1207.java new file mode 100644 index 0000000..7992aaa --- /dev/null +++ b/Master/Reference Architectures and Patterns/hjp5/examples/Listing1207.java @@ -0,0 +1,25 @@ +/* Listing1207.java */
+
+public class Listing1207
+{
+ public static void main(String[] args)
+ {
+ int i, base = 0;
+
+ try {
+ for (base = 10; base >= 2; --base) {
+ i = Integer.parseInt("40",base);
+ System.out.println("40 base "+base+" = "+i);
+ }
+ } catch (NumberFormatException e) {
+ System.out.println(
+ "40 ist keine Zahl zur Basis "+base
+ );
+ } finally {
+ System.out.println(
+ "Sie haben ein einfaches Beispiel " +
+ "sehr glücklich gemacht."
+ );
+ }
+ }
+}
\ No newline at end of file |
