Run time binding – JAVA

When we have same name of methods in super and derived class, the method in the super class gets overridden by the method in derived class at the run time, this process is called as run time binding.

//program to show concept of Run time binding

class Base

{

public void show()

{

System.out.println(“show of Base class”);

}

}

class Derived extends Base

{

public void show()

{

System.out.println(“show of Derived class”);

}

public static void main(String args[])

{

Derived ob=new Derived();

ob.show();

}

}

Leave a Reply

Your email address will not be published. Required fields are marked *