Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

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

843785Nov 17 2008 — edited Nov 17 2008
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 ?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 15 2008
Added on Nov 17 2008
16 comments
594 views