Oracle
1Z0-851 · Question #201
1Z0-851 Question #201: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-851 to reveal the answer and full explanation for question #201. The question stem and answer options stay visible for context.
Question
Given: 01. public class TestString3 { 02. public static void main(String[] args) { 03. // insert code here 04. System.out.println(s); 05. } 06. } Which two code fragments, inserted independently at line 3, generate the output 4247? (Choose two.)
Options
- AString s = "123456789"; s = (s-"123").replace(1,3,"24") - "89";
- BStringBuffer s = new StringBuffer("123456789");
- Cdelete(0,3).replace(1,3,"24").delete(4,6);
- DStringBuffer s = new StringBuffer("123456789");
- Esubstring(3,6).delete(1,3).insert(1, "24");
- FStringBuilder s = new StringBuilder("123456789");
- Gsubstring(3,6).delete(1,2).insert(1, "24");
- HStringBuilder s = new StringBuilder("123456789");
Unlock 1Z0-851 to see the answer
You've previewed enough free 1Z0-851 questions. Unlock 1Z0-851 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.