-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBankAccount.java
More file actions
35 lines (28 loc) · 828 Bytes
/
BankAccount.java
File metadata and controls
35 lines (28 loc) · 828 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
public class BankAccount {
public static void main(String []args){
System.out.println("Create account: ");
}
public class Account{
private String Depositor_name;
private int Acc_no;
private String Acc_type;
private int Balance;
public void Create_acc(String Depositor_name, int Acc_no, String Acc_type){
this.Depositor_name= Depositor_name;
this.Acc_no = Acc_no;
this. Acc_type= Acc_type;
this.Balance = Balance;
}
public void Deposit(double amount) {
Balance += amount;
}
public void withdraw(double amount) {
if (Balance >= amount) {
Balance -= amount;
}
else {
System.out.println("Insufficient balance");
}
}
}
}