aspose file tools*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "dynamic type binding " Watch "dynamic type binding " New topic

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.
It is sorta covered in the JavaRanch Style Guide.
subject: dynamic type binding
Similar Threads
Please HELP...Devaka Exam Test 2 Number 69. I totally don't understand it.
Is this a Bug in Java
Passing a refrence to another Class vs method
Java and Generics
Accessing component from main class.... Help!