Thread: Dynamic Binding
View Single Post
  #1 (permalink)  
Old 04-09-2008, 10:42 AM
javarishi javarishi is offline
Member
 
Join Date: Apr 2008
Posts: 91
javarishi is on a distinguished road
Dynamic Binding
I have two classes, Super and Sub

class Super{
int a=100
}

class Sub extends super{
int a=500;
}

class Test{
Super sup = new Sub();
S.o.p(sup.a)
}

The Output Is 100. Why In Case Of Variable JVM Does not find The SubClass One?
Reply With Quote
Sponsored Links