diff --git a/OOP/Java/Lab/Week6/BankDemo/BankDemo.java b/OOP/Java/Lab/Week6/BankDemo/BankDemo.java new file mode 100644 index 0000000..4a41fc9 --- /dev/null +++ b/OOP/Java/Lab/Week6/BankDemo/BankDemo.java @@ -0,0 +1,49 @@ +class Bank { + + double getRateOfInterest() { + return 0.0; + } +} + +class SBI extends Bank { + + double getRateOfInterest() { + return 8.0; + } +} + +class ICICI extends Bank { + + double getRateOfInterest() { + return 7.0; + } +} + +class AXIS extends Bank { + + double getRateOfInterest() { + return 9.0; + } +} + +public class BankDemo { + + public static void main(String[] args) { + Bank bank; + + bank = new SBI(); + System.out.println( + "SBI Rate of Interest: " + bank.getRateOfInterest() + "%" + ); + + bank = new ICICI(); + System.out.println( + "ICICI Rate of Interest: " + bank.getRateOfInterest() + "%" + ); + + bank = new AXIS(); + System.out.println( + "AXIS Rate of Interest: " + bank.getRateOfInterest() + "%" + ); + } +}