赞题库-背景图
单项选择题

Given:
4. public class Hemlock {
5. static StringBuffer sb;
6. StringBuffer sb2;
7. public static void main(String[] args) {
8. sb = sb.append(new Hemlock().go(new StringBuffer("hey")));
9. System.out.println(sb);
10. }
11. {sb2 = new StringBuffer("hi "); }
12. StringBuffer go(StringBuffer s) {
13. System.out.print(s + " oh " + sb2);
14. return new StringBuffer("ey");
15. }
16. static {sb = new StringBuffer("yo "); }
17. }
What is the result

A.yoey
B.hey oh hi
C.hey oh hi ey
D.oh hi hey
E.hey oh hi yo ey
F.yo hey oh hi ey
G.Compilation fails.
H.An exception is thrown at runtime.
热门试题