Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Oracle Exam 1Z0-829 Topic 10 Question 25 Discussion

Actual exam question for Oracle's 1Z0-829 exam
Question #: 25
Topic #: 10
[All 1Z0-829 Questions]

Given the code fragment:

What is the result?

Show Suggested Answer Hide Answer
Suggested Answer: B

Contribute your Thoughts:

Aleshia
9 days ago
Haha, this is a classic Java trick question. I'm going with C. The output will just be 'Dog' twice, because that's what the printAnimal() method is hard-coded to return.
upvoted 0 times
...
Isaac
11 days ago
No way, the answer has to be D. The first call to printAnimal() will return 'Cat', but the second call will return 'null' because the animal reference is null.
upvoted 0 times
...
Herminia
16 days ago
I think the answer is B. The code fragment is trying to access a member of a null object, which will throw a NullPointerException.
upvoted 0 times
...
Una
17 days ago
Hmm, that makes sense. I see your point now.
upvoted 0 times
...
Vicky
22 days ago
I disagree, I believe the answer is D) Cat null because the second element in the array is null.
upvoted 0 times
...
Una
29 days ago
I think the answer is B) A NullPointerException is thrown Cat Cat.
upvoted 0 times
...

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77