wood burning stoves*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes dynamic type binding Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "dynamic type binding " Watch "dynamic type binding " New topic
Author

dynamic type binding

aymane chetibi
Ranch Hand

Joined: Apr 12, 2006
Posts: 175
hi all,
well the question basically is does Java supports dynamic type checking?

is the following concidered to be dynamic type binding.
say you have class1 and class2 implement the same interface interface1
Ali Gohar
Ranch Hand

Joined: Mar 18, 2004
Posts: 572
interface1 i;if(....) i=new class1();else i = new class2();


Yes this is Allowed
aymane chetibi
Ranch Hand

Joined: Apr 12, 2006
Posts: 175
I know it's allowed is it dynamic biinding ??
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Originally posted by aymane chetibi:
I know it's allowed is it dynamic biinding ??


No. Dynamic binding only comes into play when you start invoking the methods through the reference to the object you create.


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
 
 
subject: dynamic type binding