1 2 Previous Next 16 Replies Latest reply: Nov 17, 2008 1:40 PM by 843785 RSS

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

    843785
      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 2 Previous Next