About Question enthuware.ocajp.i.v7.2.1195 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
Nisim123
Posts: 42
Joined: Mon Jan 20, 2014 2:26 pm
Contact:

About Question enthuware.ocajp.i.v7.2.1195 :

Post 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...
:roll:

admin
Site Admin
Posts: 10062
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocajp.i.v7.2.1195 :

Post by admin »

Why do you think there should be a compilation error?
If you like our products and services, please help us by posting your review here.

Nisim123
Posts: 42
Joined: Mon Jan 20, 2014 2:26 pm
Contact:

Re: About Question enthuware.ocajp.i.v7.2.1195 :

Post 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.
:shock:

admin
Site Admin
Posts: 10062
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocajp.i.v7.2.1195 :

Post 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?
If you like our products and services, please help us by posting your review here.

Nisim123
Posts: 42
Joined: Mon Jan 20, 2014 2:26 pm
Contact:

Re: About Question enthuware.ocajp.i.v7.2.1195 :

Post by Nisim123 »

well, i thought that the reason is something like that but i wasn't sure,
thanks for the patience....
;)

Dreamweaver
Posts: 32
Joined: Mon Dec 29, 2014 4:14 pm
Contact:

Re: About Question enthuware.ocajp.i.v7.2.1195 :

Post 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?

admin
Site Admin
Posts: 10062
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocajp.i.v7.2.1195 :

Post by admin »

Which exam are you taking?
If you like our products and services, please help us by posting your review here.

Dreamweaver
Posts: 32
Joined: Mon Dec 29, 2014 4:14 pm
Contact:

Re: About Question enthuware.ocajp.i.v7.2.1195 :

Post by Dreamweaver »

1Z0-808 - Java SE 8 Programmer I

admin
Site Admin
Posts: 10062
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocajp.i.v7.2.1195 :

Post by admin »

You may ignore it.
If you like our products and services, please help us by posting your review here.

enthunoob
Posts: 60
Joined: Thu Apr 15, 2021 12:21 pm
Contact:

Re: About Question enthuware.ocajp.i.v7.2.1195 :

Post by enthunoob »

'Select 3 options' is kind of a give away here :)

Post Reply

Who is online

Users browsing this forum: No registered users and 56 guests