Oracle
1Z0-803 · Question #127
1Z0-803 Question #127: Real Exam Question with Answer & Explanation
The correct answer is C: mother. See the full explanation below for the reasoning.
Question
Given: class X { static void m(StringBuilder sb1) { sb1.append("er"); } public static void main (String[] args) { StringBuilder sb2 = new StringBuilder("moth"); m(sb2); System.out.println(sb2); } } What is the result?
Options
- Amoth
- Ber
- Cmother
- DCompilation fails
- EAn exception is thrown at run time
Community Discussion
No community discussion yet for this question.