Oracle
1Z0-819 · Question #128
1Z0-819 Question #128: Real Exam Question with Answer & Explanation
The correct answer is A. 4. See the full explanation below for the reasoning.
Question
Given public class Tester {
public static void main(String[] args) {
StringBuilder sb = new StringBuilder(5);
sb.append("HOWDY");
sb.insert(1, "LL");
sb.replace(3, 5, "COW");
sb.delete(2, 7);
System.out.println(sb.length());
}
}
What is the result?
Options
- A4
- B3
- CThe code does not compile
- D5
Community Discussion
No community discussion yet for this question.