bing
Flat 10% & upto 50% off + Free additional Courses. Hurry up!

Static and Dynamic Binding

 

Calling a method body is known as binding. There are two types of bindings-

  • Static Binding
  • Dynamic Binding

 

1. Static Binding – It is also known as early binding. When type of an object is determined at compile time, then it is known as static binding. When there is private, static and final keyword is used in the class then there is static binding.

e.g.

class Calculation

{

public void operation()

{

System.out.println("Calculation class");

}

public static void main(String[] args)

{

Calculation c =new Calculation ();

c.operation();

}

}

Output

Calculation class

 

2. Dynamic Binding – It is also known as late binding. When type of an object is determined at run time, then it is known as static binding.

e.g.

class Flower

{

public void smell()

{

System.out.pritnln("Class Flower");

}

}

 

class Rose extends Flower

{

public void smell()

{

System.out.println("Class Rose");

}

public static void main(String[] args)

{

Flower fl=new Rose ();

fl.smell();

}

}

Output

Class Rose

Learn more about Cross-Platform Mobile Technology for Android and iOS using Java in this insightful blog now!

"0 Responses on Static and Dynamic Binding"

Training in Cities

Bangalore, Hyderabad, Chennai, Delhi, Kolkata, UK, London, Chicago, San Francisco, Dallas, Washington, New York, Orlando, Boston

100% Secure Payments. All major credit & debit cards accepted Or Pay by Paypal.

top

Sales Offer

  • To avail this offer, enroll before 07th December 2016.
  • This offer cannot be combined with any other offer.
  • This offer is valid on selected courses only.
  • Please use coupon codes mentioned below to avail the offer
offer-june

Sign Up or Login to view the Free Static and Dynamic Binding.