File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments