Cyber Monday 2024! 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-811 Topic 6 Question 39 Discussion

Actual exam question for Oracle's 1Z0-811 exam
Question #: 39
Topic #: 6
[All 1Z0-811 Questions]

Given the code fragment:

Which code fragment, when inserted at line n1, enables it to print Rita is 14 years old?

Show Suggested Answer Hide Answer
Suggested Answer: C

Contribute your Thoughts:

Claribel
2 months ago
I agree with Bobbye, C seems like the correct answer based on the syntax.
upvoted 0 times
...
Bobbye
2 months ago
I'm not sure, but I think C makes more sense because printf is used for formatted output.
upvoted 0 times
...
Ciara
3 months ago
I disagree, I believe the answer is A.
upvoted 0 times
...
Pedro
3 months ago
I'm going with C. It's the classic way to do formatted output in Java. Simple and straightforward.
upvoted 0 times
...
Sena
3 months ago
I think the answer is C.
upvoted 0 times
...
Isaac
3 months ago
Haha, D is just asking for trouble with that '%n' business. Good luck getting that to print properly!
upvoted 0 times
Shelba
2 months ago
I agree, A or C would be the safer choices here.
upvoted 0 times
...
Daniel
2 months ago
Yeah, D would definitely cause some issues with that '%n'. Stick with A or C.
upvoted 0 times
...
Josue
2 months ago
C) System.out.printf(''%s is %d years old'', name, age);
upvoted 0 times
...
Florinda
2 months ago
A) System.out.println(''%s is %d years old'' +name+age);
upvoted 0 times
...
...
Alyssa
3 months ago
Option C is the way to go! It's the only one that uses the correct format specifiers for String and int types.
upvoted 0 times
Lorenza
3 months ago
Thanks for pointing that out, I'll go with option C.
upvoted 0 times
...
Lorenza
3 months ago
I agree, option C is the correct one.
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