Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- abstract class Bank{
- abstract int getRateOfInterest();}
- class SBI extends Bank{
- int getRateOfInterest()
- {return 7;}
- }
- class PNB extends Bank{
- int getRateOfInterest()
- {return 8;}
- }
- class TestBank{
- public static void main(String args[]){
- Bank b;
- b=new SBI();
- System.out.println("Rate of Interest is :"+b.getRateOfInterest()+"%");
- b=new PNB();
- System.out.println("Rate of Interest is :"+b.getRateOfInterest()+"%");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement