File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -31,9 +31,9 @@ public static void main(String[] args) {
31
31
e2 .setSalaryInEuro (77000 );
32
32
e3 .setSalaryInEuro (45000 );
33
33
} catch (SalaryDecreaseException e ) {
34
- System .out .println ("Das neue Gehalt muss hoeher sein als das bisherige" );
34
+ System .out .println (e . getMessage () );
35
35
} catch (SalaryIncreaseTooHighException e ) {
36
- System .out .println ("Das neue Gehalt darf maximal 10% ueber dem bisherigen Gehalt liegen" );
36
+ System .out .println (e . getMessage () );
37
37
}
38
38
39
39
// alternative instance of
@@ -43,10 +43,10 @@ public static void main(String[] args) {
43
43
e3 .setSalaryInEuro (45000 );
44
44
} catch (Exception e ) {
45
45
if (e instanceof SalaryDecreaseException ) {
46
- System .out .println ("Das neue Gehalt muss hoeher sein als das bisherige" );
46
+ System .out .println (e . getMessage () );
47
47
}
48
48
if (e instanceof SalaryIncreaseTooHighException ) {
49
- System .out .println ("Das neue Gehalt darf maximal 10% ueber dem bisherigen Gehalt liegen" );
49
+ System .out .println (e . getMessage () );
50
50
}
51
51
}
52
52
You can’t perform that action at this time.
0 commit comments