|
@@ -3,7 +3,7 @@ package rocks.zipcode.quiz5.objectorientation.account;
|
3
|
3
|
/**
|
4
|
4
|
* @author leon on 27/12/2018.
|
5
|
5
|
*/
|
6
|
|
-public class BankAccount implements Transactable{
|
|
6
|
+public class BankAccount extends Account implements Transactable{
|
7
|
7
|
private Double val;
|
8
|
8
|
|
9
|
9
|
public Double getVal() {
|
|
@@ -15,22 +15,19 @@ public class BankAccount implements Transactable{
|
15
|
15
|
this.val = val;
|
16
|
16
|
}
|
17
|
17
|
|
|
18
|
+
|
18
|
19
|
@Override
|
19
|
20
|
public void deposit(Double amountToIncreaseBy) {
|
20
|
|
- BankAccount ba = new BankAccount();
|
21
|
|
- ba.setBalance(ba.getBalance() + amountToIncreaseBy);
|
|
21
|
+
|
22
|
22
|
}
|
23
|
23
|
|
24
|
24
|
@Override
|
25
|
25
|
public void withdrawal(Double amountToDecreaseBy) {
|
26
|
|
- BankAccount ba = new BankAccount();
|
27
|
|
- ba.setBalance(ba.getBalance() + amountToDecreaseBy);
|
28
|
26
|
|
29
|
27
|
}
|
30
|
28
|
|
31
|
29
|
@Override
|
32
|
30
|
public Double getBalance() {
|
33
|
|
-
|
34
|
31
|
return null;
|
35
|
32
|
}
|
36
|
33
|
}
|