summaryrefslogtreecommitdiffstats
path: root/Master/Reference Architectures and Patterns/hjp5/examples/RTErrorProg2.java
diff options
context:
space:
mode:
Diffstat (limited to 'Master/Reference Architectures and Patterns/hjp5/examples/RTErrorProg2.java')
-rw-r--r--Master/Reference Architectures and Patterns/hjp5/examples/RTErrorProg2.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/Master/Reference Architectures and Patterns/hjp5/examples/RTErrorProg2.java b/Master/Reference Architectures and Patterns/hjp5/examples/RTErrorProg2.java
new file mode 100644
index 0000000..7c4ce59
--- /dev/null
+++ b/Master/Reference Architectures and Patterns/hjp5/examples/RTErrorProg2.java
@@ -0,0 +1,20 @@
+/* RTErrorProg2.java */
+
+public class RTErrorProg2
+{
+ 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("***Fehler aufgetreten***");
+ System.out.println("Ursache: "+e.getMessage());
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file