Skip to content

Commit 099f251

Browse files
committed
Use correct message
1 parent 34b9860 commit 099f251

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Exercise.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ public static void main(String[] args) {
3131
e2.setSalaryInEuro(77000);
3232
e3.setSalaryInEuro(45000);
3333
} catch (SalaryDecreaseException e) {
34-
System.out.println("Das neue Gehalt muss hoeher sein als das bisherige");
34+
System.out.println(e.getMessage());
3535
} catch (SalaryIncreaseTooHighException e) {
36-
System.out.println("Das neue Gehalt darf maximal 10% ueber dem bisherigen Gehalt liegen");
36+
System.out.println(e.getMessage());
3737
}
3838

3939
// alternative instance of
@@ -43,10 +43,10 @@ public static void main(String[] args) {
4343
e3.setSalaryInEuro(45000);
4444
} catch (Exception e) {
4545
if (e instanceof SalaryDecreaseException) {
46-
System.out.println("Das neue Gehalt muss hoeher sein als das bisherige");
46+
System.out.println(e.getMessage());
4747
}
4848
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());
5050
}
5151
}
5252

0 commit comments

Comments
 (0)