-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClosedState.java
More file actions
26 lines (20 loc) · 753 Bytes
/
ClosedState.java
File metadata and controls
26 lines (20 loc) · 753 Bytes
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
public class ClosedState implements AccountState{
public String getState(){
return "closed";
}
public void closeState(Account account){
System.out.println("Account is already closed!");
}
public void suspendState(Account account){
System.out.println("You cannot suspend a closed account!");
}
public void activateState(Account account){
System.out.println("You cannot activate a closed account!");
}
public void deposit(Account account, double depositAmount){
System.out.println("You cannot deposit on closed account!");
}
public void withdraw(Account account, double withdrawAmount){
System.out.println("You cannot withdraw on closed account!");
}
}