可学答题网 > 问答 > OCJP(310-065)题库
目录: 标题| 题干| 答案| 搜索| 相关
问题

Given: 22.StringBuilder sb1&ensp


Given: 22.StringBuilder sb1 = new StringBuilder("123"); 23.String s1 = "123"; 24.// insert code here 25.System.out.println(sb1 + " " + s1); Which code fragment, inserted at line 24, outputs "123abc 123abc"?()

  • Asb1.append("abc"); s1.append("abc");
  • Bsb1.append("abc"); s1.concat("abc");
  • Csb1.concat("abc"); s1.append("abc");
  • Dsb1.concat("abc"); s1.concat("abc");
  • Esb1.append("abc"); s1 = s1.concat("abc");
参考答案
参考解析:
分类:OCJP(310-065)题库
相关推荐

1、Given:   10. class&ens

Given:  10. class One {  11. void foo() { }  12. }  13. class Two e...

2、Given:   11. static&en

Given:  11. static class A {  12. void process() throws Exception { throw new Exce...

3、Given classes defined 

Given classes defined in two different files:What is required at line 5 in class SomeApp ...

4、Given the Tag:  

Given the Tag:  Assuming the tag referenced by my Tags: get Advice uses the Classic&ensp...

5、Given:   11. // i

Given:  11. // insert code here  12. private N min, max;  13. public N getMin...

6、Given classes defined 

Given classes defined in two different files: 1. package util; 2. public class BitUtils {&ens...