diff options
Diffstat (limited to 'Master/Reference Architectures and Patterns/hjp5/examples/Listing1205.java')
| -rw-r--r-- | Master/Reference Architectures and Patterns/hjp5/examples/Listing1205.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Master/Reference Architectures and Patterns/hjp5/examples/Listing1205.java b/Master/Reference Architectures and Patterns/hjp5/examples/Listing1205.java new file mode 100644 index 0000000..852902f --- /dev/null +++ b/Master/Reference Architectures and Patterns/hjp5/examples/Listing1205.java @@ -0,0 +1,20 @@ +/* Listing1205.java */
+
+public class Listing1205
+{
+ public static void main(String[] args)
+ {
+ int i, base = 0;
+
+ for (base = 10; base >= 2; --base) {
+ try {
+ 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
+ );
+ }
+ }
+ }
+}
\ No newline at end of file |
