-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathISADemo.java
More file actions
65 lines (53 loc) · 1.05 KB
/
ISADemo.java
File metadata and controls
65 lines (53 loc) · 1.05 KB
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
class Account
{
double balance=10000;
int accountNo;
void checkBalance(){
System.out.println("balance is "+balance);
}
void roi(){}
void withDraw(){
System.out.println("Common WithDraw..");
}
void deposit(){
System.out.println("Account Class Deposit...");
}
}
class SavingAccount extends Account
{
@Override
void roi(){
System.out.println("Saving AC ROI Call");
}
// Annontation
@Override
void withDraw(){
System.out.println("Saving Account Limit for withdraw...");
}
}
class CurrentAccount extends Account{
void odLimit(){
System.out.println("CA OD Limit...");
}
@Override
void roi(){
System.out.println("Current AC ROI Call");
}
}
public class ISADemo {
public static void main(String[] args) {
// TODO Auto-generated method stub
SavingAccount sa = new SavingAccount();
sa.checkBalance();
sa.deposit();
sa.withDraw();
sa.roi();
System.out.println("**********************");
CurrentAccount ca = new CurrentAccount();
ca.checkBalance();
ca.deposit();
ca.withDraw();
ca.roi();
ca.odLimit();
}
}