-
Notifications
You must be signed in to change notification settings - Fork 0
/
BasicBank.java
58 lines (45 loc) · 1.08 KB
/
BasicBank.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
class Bank
{
String name;
String type;
int custID;
double bal;
Bank(String m,String cl,int c,double w)
{
name=m;
type=cl;
custID=c;
bal=w;
}
void display()
{
System.out.println("Welcome " + name+"! . your accouont type is "+type+". Your custID is "+ custID + ". Your bal is "+ bal);
}
void balance()
{
System.out.println("Hello " + name + " your balance is "+ bal);
}
void withdraw(double a)
{
a=a;
bal=bal-a;
}
void deposite(double b)
{
b=b;
bal=bal+b;
}
}
public class BasicBank{
public static void main(String args[])
{
Bank c1=new Bank("Ramesh", "saving", 501, 10000);
Bank c2=new Bank("Suresh", "current", 404, 10000);
c1.display();
c2.display();
c1.withdraw(1);
c2.deposite(1);
c1.balance();
c2.balance();
}
}