-
Notifications
You must be signed in to change notification settings - Fork 0
/
Account.java
99 lines (84 loc) · 1.81 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/*Create a class Account with properties like accountNo, name,
address, phoneNo, dob, balance.
Write getter and setter methods for all properties
Create Parameterized Constructor for class Account.
Create a method closeAccount()
Create a class SavingsAccount which inherits Account class.
Create different methods in SavingsAccount class like withdraw(),
deposit(), fixedDeposit().
Create a class LoanAccount which also inherits Account class.
Create different methods in LoanAccount class like payEMI(),
topUpLoan(), repayment()*/
package inheritance;
public class Account
{
private long accountNo;
private String name;
private String address;
private long phoneNo;
private String dob;
private long balance;
//Parameterised Constructor
// Account(long )
// {
// }
//set & get account number
public void setAccountNo(long accountNo)
{
this.accountNo=accountNo;
}
public long getAccountNo()
{
return accountNo;
}
//set & get your name
public void setName(String Name)
{
this.name=name;
}
public String getName()
{
return name;
}
//set & get your address
public void setAddress(String address)
{
this.address=address;
}
public String getAddress()
{
return address;
}
//set & get your phoneNo
public void setPhoneNo(long phoneNo)
{
this.phoneNo=phoneNo;
}
public long getPhoneNo()
{
return phoneNo;
}
//set & get your dob
public void setDob(String dob)
{
this.dob=dob;
}
public String getDob()
{
return dob;
}
//set & get for balance
public void setBalance(long balance)
{
this.balance=balance;
}
public long getBalance()
{
return balance;
}
//method for closing account
public void closeAccount()
{
System.out.println("Account closed");
}
}