-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAccount.java
More file actions
51 lines (39 loc) · 858 Bytes
/
Account.java
File metadata and controls
51 lines (39 loc) · 858 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package chap07;
public class Account {
private String accId;
private long balance;
private String ownerName;
public Account() {
// TODO Auto-generated constructor stub
}
public Account(String accId, long balance, String ownerName) {
super();
this.accId = accId;
this.balance = balance;
this.ownerName = ownerName;
}
public void deposit(long amount) {
this.balance = balance + amount;
}
public void withdraw(long amount) {
this.balance = balance - amount;
}
public String getAccId() {
return accId;
}
public void setAccId(String accId) {
this.accId = accId;
}
public long getBalance() {
return balance;
}
public void setBalance(long balance) {
this.balance = balance;
}
public String getOwnerName() {
return ownerName;
}
public void setOwnerName(String ownerName) {
this.ownerName = ownerName;
}
}