Class SavingsAccount
java.lang.Object
|
+----BankAccount
|
+----SavingsAccount
- public class SavingsAccount
- extends BankAccount
Die Klasse SavingsAccount beschreibt einfache Sparkonten.
SavingsAccount ist ein Erbe von BankAccount mit Methoden
zum Feststellen des Zinssatzes und Abbuchen der Zinsen.
-
interestRate
-
-
SavingsAccount(double, double)
- Der Konstruktor setzt den Anfangskontostand und den Zinssatz fest.
-
addInterest()
- Die Methode addInterest fuegt die angefallenen Zinsen zum
Kontostand hinzu.
-
getInterestRate()
- Die Methode getInterestRate gibt den Zinssatz an.
-
toString()
- Die Methode toString definiert eine textuelle Repraesentation
fuer SavingsAccount-Objekte.
interestRate
private double interestRate
SavingsAccount
public SavingsAccount(double initialBalance,
double rate)
- Der Konstruktor setzt den Anfangskontostand und den Zinssatz fest.
addInterest
public void addInterest()
- Die Methode addInterest fuegt die angefallenen Zinsen zum
Kontostand hinzu.
getInterestRate
public double getInterestRate()
- Die Methode getInterestRate gibt den Zinssatz an.
toString
public String toString()
- Die Methode toString definiert eine textuelle Repraesentation
fuer SavingsAccount-Objekte.
- Overrides:
- toString in class BankAccount