Forum Stats

  • 3,769,695 Users
  • 2,253,008 Discussions
  • 7,875,155 Comments

Discussions

Static Binding and Dynamic Binding..they aren't straight forward are they ?

843785
843785 Member Posts: 49,981
edited Nov 17, 2008 4:28PM in New To Java
Well i have understood a little about static binding and dynamic binding but still missing a few puzzles.

Static binding happens when we call a static member of a class or an instance method that is private or when i implement method overloading.

Dynamic binding happens when i use Virtual Method Invocation or Override a method.

so,
class A
{
 public void display()
 {
  System.out.println("Display");
 }
}
class B
{
 public static void main(String args[])
 {
  A ref = new A();
  ref.display();
 }
}
Is this static binding ?
«1

Comments

This discussion has been closed.