loading
Main.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
class Main {
  public static void main(String[] args) {
    Bank b;

    b = new SBI();

    System.out.println("SBI Rate of Interest: " + b.getRateOfInterest());

    b = new ICICI();

    System.out.println("ICICI Rate of Interest: " + b.getRateOfInterest());

    b = new AXIS();

    System.out.println("AXIS Rate of Interest: " + b.getRateOfInterest());
  }
}

class Bank{
  float getRateOfInterest(){
    return 0;
  }
}

class SBI extends Bank {
  @Override
  float getRateOfInterest(){
    return 8.4f;
  }
}

class ICICI extends Bank {
  @Override
  float getRateOfInterest(){
    return 7.3f;
  }
}

class AXIS extends Bank {
  @Override
  float getRateOfInterest(){
    return 9.7f;
  }
}