Independence Day Deal! Unlock 25% OFF Today – Limited-Time Offer - 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:

Jesusa
2 months ago
Wait, are we supposed to be coding or just guessing randomly? I'm going to go with A, because who doesn't love a good 'Cat Dog' combo, am I right?
upvoted 0 times
Harley
15 days ago
I believe the correct answer is B) A NullPointerException is thrown
upvoted 0 times
...
Sabra
18 days ago
I agree, let's analyze the code fragment to determine the result.
upvoted 0 times
...
Francene
26 days ago
I think we are supposed to be coding, not guessing randomly.
upvoted 0 times
...
...
Aleshia
2 months 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
Gladys
22 hours ago
I see where you're coming from, but I still think it's C. The output will be 'Dog' twice.
upvoted 0 times
...
Yvette
8 days ago
I'm not sure about this one. I think it might be D. The output will be 'Cat' followed by 'null'.
upvoted 0 times
...
Margarita
11 days ago
I agree with you, I also think it's B. The code will throw a NullPointerException.
upvoted 0 times
...
Annelle
1 months ago
I think it's B. A NullPointerException will be thrown because the animal variable is not initialized.
upvoted 0 times
...
...
Isaac
2 months 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
Alesia
1 months ago
I disagree, the correct answer is D. The first call will print 'Cat' but the second call will print 'null'.
upvoted 0 times
...
Ming
2 months ago
I think the answer is B. The first call will print 'Cat' and the second call will also print 'Cat'.
upvoted 0 times
...
...
Herminia
2 months 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
2 months ago
Hmm, that makes sense. I see your point now.
upvoted 0 times
...
Vicky
2 months ago
I disagree, I believe the answer is D) Cat null because the second element in the array is null.
upvoted 0 times
...
Una
3 months 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