-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUser.java
More file actions
35 lines (27 loc) · 749 Bytes
/
User.java
File metadata and controls
35 lines (27 loc) · 749 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
27
28
29
30
31
32
33
34
35
import java.io.Serializable;
// For Creating Users
public class User implements Serializable {
private String username;
private String password;
private int amount;
public User(String username, String password, int amount) {
this.username = username;
this.password = password;
this.amount = amount;
}
public String getUsername() {
return username;
}
public String getPassword() {
return password;
}
public int getAmount() {
return this.amount;
}
public void depositAmount(int amountToDeposit) {
this.amount += amountToDeposit;
}
public void withdrawAmount(int amountToWithdraw) {
this.amount -= amountToWithdraw;
}
}