forked from cybernobie/Cognizant_Early_Engagement
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Account.java
35 lines (33 loc) · 844 Bytes
/
Account.java
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
public class Account{
private int accountId;
private String accountType;
private int balance;
public int getAccountId() {
return accountId;
}
public void setAccountId(int accountId) {
this.accountId = accountId;
}
public String getAccountType() {
return accountType;
}
public void setAccountType(String accountType) {
this.accountType = accountType;
}
public int getBalance() {
return balance;
}
public void setBalance(int balance) {
this.balance = balance;
}
public boolean withdraw(int amount){
if(balance >= amount){
balance -= amount;
System.out.println("Balance amount after withdraw:"+balance);
return true;
}else{
System.out.println("Sorry!!! No enough balance");
return false;
}
}
}