Page 1 of 1
About Question enthuware.ocajp.i.v7.2.1195 :
Posted: Fri May 23, 2014 2:55 am
by Nisim123
What makes this code compilable anyway?
It uses the instanceof method on classes and not on interface...
and the explanation says that:
The object is not an instance of D.
Well... there is no choice of compilation error among the given options
so we might guess that in this case
it might return false...

Re: About Question enthuware.ocajp.i.v7.2.1195 :
Posted: Fri May 23, 2014 3:27 am
by admin
Why do you think there should be a compilation error?
Re: About Question enthuware.ocajp.i.v7.2.1195 :
Posted: Fri May 23, 2014 3:52 am
by Nisim123
Because of a similar case in question: enthuware.ocajp.i.v7.2.838
Where the statement "if(b instanceof Bird) System.out.println("f is a Bird");"
caused a compilation error when b is an instance of a class named "Bat" that is not inheriting
from class Bird.

Re: About Question enthuware.ocajp.i.v7.2.1195 :
Posted: Fri May 23, 2014 4:11 am
by admin
But here D does does extend from C. The other question explains why you get a compilation error there. Is there something that is not clear?
Re: About Question enthuware.ocajp.i.v7.2.1195 :
Posted: Fri May 23, 2014 5:29 am
by Nisim123
well, i thought that the reason is something like that but i wasn't sure,
thanks for the patience....

Re: About Question enthuware.ocajp.i.v7.2.1195 :
Posted: Wed Jul 08, 2020 4:02 am
by Dreamweaver
Hi,
I will go to exam at 15 August 2020,
Do you know if Instanceof Operator will be part of the exam in this period?
Re: About Question enthuware.ocajp.i.v7.2.1195 :
Posted: Wed Jul 08, 2020 4:57 am
by admin
Which exam are you taking?
Re: About Question enthuware.ocajp.i.v7.2.1195 :
Posted: Wed Jul 08, 2020 3:47 pm
by Dreamweaver
1Z0-808 - Java SE 8 Programmer I
Re: About Question enthuware.ocajp.i.v7.2.1195 :
Posted: Wed Jul 08, 2020 8:03 pm
by admin
You may ignore it.
Re: About Question enthuware.ocajp.i.v7.2.1195 :
Posted: Wed Jul 14, 2021 10:24 am
by enthunoob
'Select 3 options' is kind of a give away here
