Runtime Polymorphism - LearnHowToCode SarkariResult.com Interview Questions and Answers LearnHowToCodeOnline
Runtime Polymorphism

Runtime Polymorphism

Runtime Polymorphism ( Dynamic polymorphism)

It is also known as Dynamic Method Dispatch. Dynamic polymorphism is a process in which a call to an overridden method is resolved at runtime, thats why it is called runtime polymorphism. I have already discussed method overriding in detail in a separate tutorial, refer it: method overloading in java

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

 }

 class SBI extends Bank{float getdata()
 {return 5.6f; }
 }
 
 
 class PNB extends Bank{float getdata()
 {  return 7.7f; }
 }
 
 class Barodra extends Bank{float getdata()
 {return 9.7f; }
 }

 class TestDTM{
public static void main (String[]args)
     {
     Bank b;
 
   b =new SBI();
    System.out.println("SbI intrest persentage"+ b.getdata());
b =new PNB();
    System.out.println("PNB intrest persentage"+ b.getdata());

b =new Barodra();
    System.out.println("baroda intrest persentage"+ b.getdata());
  }
 }




About EasyToCode

I'm Ethan Mariano a software engineer by profession and reader/writter by passion.I have good understanding and knowledge of AngularJS, Database, javascript, web development, digital marketing and exploring other technologies related to Software development.

0 comments:

Featured post

Political Full Forms List

Acronym Full Form MLA Member of Legislative Assembly RSS Really Simple Syndication, Rashtriya Swayamsevak Sangh UNESCO United Nations E...

Powered by Blogger.