exam questions

Exam 1z0-808 All Questions

View all questions & answers for the 1z0-808 exam

Exam 1z0-808 topic 1 question 205 discussion

Actual exam question from Oracle's 1z0-808
Question #: 205
Topic #: 1
[All 1z0-808 Questions]

Given:
and the code fragment:

What is the result?

  • A. true:false:true
  • B. false:true:true
  • C. false:true:false
  • D. true:true:false
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
tawa_z58
1 year ago
The answer is B because P2 has inherited from P1 therefore any object of P2 can be called P1's instance.
upvoted 1 times
...
carloswork
2 years, 2 months ago
Selected Answer: B
Answer is B. class P1{} class P2 extends P1 implements I1 {} interface I1{} public class Test { public static void main(String[] args) { P1 obj = new P1(); P2 obj2 = new P2(); I1 obj3 = new P2(); boolean r1 = obj instanceof P2; boolean r2 = obj2 instanceof P1; boolean r3 = obj3 instanceof I1; System.out.println(r1 + ":" + r2 + ":" + r3); } }
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...