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.


Variable Index

 o interestRate

Constructor Index

 o SavingsAccount(double, double)
Der Konstruktor setzt den Anfangskontostand und den Zinssatz fest.

Method Index

 o addInterest()
Die Methode addInterest fuegt die angefallenen Zinsen zum Kontostand hinzu.
 o getInterestRate()
Die Methode getInterestRate gibt den Zinssatz an.
 o toString()
Die Methode toString definiert eine textuelle Repraesentation fuer SavingsAccount-Objekte.

Variables

 o interestRate
 private double interestRate

Constructors

 o SavingsAccount
 public SavingsAccount(double initialBalance,
                       double rate)
Der Konstruktor setzt den Anfangskontostand und den Zinssatz fest.

Methods

 o addInterest
 public void addInterest()
Die Methode addInterest fuegt die angefallenen Zinsen zum Kontostand hinzu.

 o getInterestRate
 public double getInterestRate()
Die Methode getInterestRate gibt den Zinssatz an.

 o toString
 public String toString()
Die Methode toString definiert eine textuelle Repraesentation fuer SavingsAccount-Objekte.

Overrides:
toString in class BankAccount