strb1.append(3.14159);
strb1.append(’数’);
strb1.append(true);
strb1.append(intObj);
第1题:
第2题:
下列关于String类和stringBuffer类说法正确的有()。
第3题:
StringBuffer append(数值类型 t),参数t可以是boolean、int、char、float、double、long
第4题:
11. public void genNumbers() { 12. ArrayList numbers = new ArrayList(); 13. for (int i=0; i<10; i++) { 14. int value = i * ((int) Math.random()); 15. Integer intObj = new Integer(value); 16. numbers.add(intObj); 17. } 18. System.out.println(numbers); 19. } Which line of code marks the earliest point that an object referenced by intObj becomes a candidate for garbage collection?()
第5题:
以下关于字符串函数的描述中,正确的是()
第6题:
Public class test ( Public static void stringReplace (String text) ( Text = text.replace (‘j’ , ‘i’); ) public static void bufferReplace (StringBuffer text) ( text = text.append (“C”) ) public static void main (String args[]} ( String textString = new String (“java”); StringBuffer text BufferString = new StringBuffer (“java”); stringReplace (textString); bufferReplace (textBuffer); System.out.printLn (textString + textBuffer); ) ) What is the output?()
第7题:
String类的concat()方法与StringBuffer类的append()方法都可以连接两个字符串,它们之间有何不同?
第8题:
This code is NOT thread-safe.
The programmer can replace StringBuffer with StringBuilder with no other changes.
This code will perform well and converting the code to use StringBuilder will not enhance the performance.
This code will perform poorly. For better performance, the code should be rewritten: return “<“+ this.name + “>”;
第9题:
第10题:
strb1.append(3.14159);
strb1.append(’数’);
strb1.append(true);
strb1.append(intObj);
第11题:
Line 19
The object is NOT a candidate for garbage collection.
Line 17
Line 16
Line 18
第12题:
对
错
第13题:
字符串的append函数可以添加多种内容,以下append函数的使用中,错误的是() StringBuffer strb1 = new StringBuffer(); Integer intObj = new Integer(33);
第14题:
String与StringBuffer最大的区别在于()
第15题:
public static void main( String[] args ) { Integer a = new Integer(10); Integer b = new Integer(10); Integer c = a; int d = 10; double e = 10.0; } Which three evaluate to true?()
第16题:
定义有StringBuffer s1=new StringBuffer(10);s1.append(“1234”)则s1.length()和s1.capacity()分别是多少?
第17题:
Given this method in a class: public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append(‟<‟); buffer.append(this.name); buffer.append(‟>‟); return buffer.toString(); } Which is true?()
第18题:
public class SyncTest{ public static void main(String args) { final StringBuffer s1= new StringBuffer(); final StringBuffer s2= new StringBuffer(); new Thread () { public void run() { synchronized(s1) { s2.append(“A”); synchronized(s2) { s2.append(“B”); System.out.print(s1); System.out.print(s2); } } } }.start(); new Thread() { public void run() { synchronized(s2) { s2.append(“C”); synchronized(s1) { s1.append(“D”); System.out.print(s2); System.out.print(s1); } } } }.start(); } } Which two statements are true? ()
第19题:
以下语句的含义是() char[] arrcrlf={13,10}; String crlf=new String(arrcrlf); stringBuffer dest = new StringBuffer("西行漫记"); dest.append(crlf);
第20题:
第21题:
(a == c)
(d == e)
(b == d)
(a == b)
(b == c)
(d == 10.0)
第22题:
append函数用于在已有的字符串末尾添加新的内容
insert函数的作用是在字符串的某个位置插入一个字符
setCharAt函数的作用是将String或StringBuffer字符串的某个字符串替换
replace函数的作用是替换一段子串 E delete函数用语删除整个字符串
第23题:
字符串西行漫记不变
字符串西行漫记的最后一个字被删除
语句存在语法错误
在字符串西行漫记的后面加回车换行符
第24题:
The program prints “ABBCAD”
The program prints “CDDACB”
The program prints “ADCBADBC”
The output is a non-deterministic point because of a possible deadlock condition.
The output is dependent on the threading model of the system the program is running on.