diff options
Diffstat (limited to 'src/de/fhswf/in/inf/java1/aufgabe5/Konto.java')
| -rw-r--r-- | src/de/fhswf/in/inf/java1/aufgabe5/Konto.java | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/de/fhswf/in/inf/java1/aufgabe5/Konto.java b/src/de/fhswf/in/inf/java1/aufgabe5/Konto.java index 24194b3..d7dda13 100644 --- a/src/de/fhswf/in/inf/java1/aufgabe5/Konto.java +++ b/src/de/fhswf/in/inf/java1/aufgabe5/Konto.java @@ -68,7 +68,7 @@ public class Konto { throw new IllegalArgumentException("Betrag can't be negative"); } - if (guthaben.add(dispo).compareTo(betrag) >= 0) + if (guthaben.add(dispo).compareTo(betrag) < 0) { throw new IllegalArgumentException("Betrag surpasses dispo limit"); } @@ -96,4 +96,24 @@ public class Konto guthaben = guthaben.add(betrag); } + /** + * Returns the actual balance. + * + * @return Returns the actual balance. + */ + public BigDecimal getKontostand() + { + return guthaben; + } + + /** + * Just to get the owners name. + * + * @return Returns the owners name. + */ + public String getBesitzer() + { + return besitzer.getName(); + } + } |
