Oracle
1Z0-803 · Question #76
1Z0-803 Question #76: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-803 to reveal the answer and full explanation for question #76. The question stem and answer options stay visible for context.
Question
Given the code fragment: String name = "Spot"; int age = 4; String str ="My dog " + name + " is " + age; System.out.println(str); And StringBuilder sb = new StringBuilder(); Using StringBuilder, which code fragment is the best potion to build and print the following string My dog Spot is 4
Options
- Asb.append("My dog " + name + " is " + age);
- Bsb.insert("My dog ").append( name + " is " + age);
- Csb.insert("My dog ").insert( name ).insert(" is
- Dsb.append("My dog ").append( name ).append(" is
Unlock 1Z0-803 to see the answer
You've previewed enough free 1Z0-803 questions. Unlock 1Z0-803 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.