summaryrefslogtreecommitdiffstats
path: root/src/de/fhswf/in/inf/java1/aufgabe5/Bank.java
blob: 22cb577a8c3ebe6a9532f577bea3df86f62da069 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/**
 * 
 */
package de.fhswf.in.inf.java1.aufgabe5;

import java.math.BigDecimal;

/**
 * Package for main function.
 *
 * @author $Author: $
 * @version $Revision: $, $Date: $ UTC
 */
public final class Bank
{

   /**
    * Prevents instantiation of the unity class Bank.
    *
    */
   private Bank()
   {

   }

   /**
    * Main function for testing the Bank system.
    *
    * @param args
    *           Shell arguments
    */
   public static void main(String[] args)
   {
      Person dieter = new Person("Dieter", "Hallowegers");

      Konto giro = new Konto(dieter, new BigDecimal(100));

      try
      {
         giro.einzahlen(new BigDecimal(100));
         giro.abheben(new BigDecimal(200));
         
         System.out.println(giro.getKontostand());
         
         giro.abheben(new BigDecimal(1));
      }
      catch (IllegalArgumentException e)
      {
         System.out.println(e);
      }

   }

}