题目内容

下列哪一个是正确的( )

A. HashTable的关键字不允许为null,值允许为null
B. HashTable的关键字允许为null,值不允许为null
C. HashTable的关键字和值都不允许为null
D. HashTable的关键字和值都允许为null

查看答案
更多问题

对于下列代码:String str1="java";String str2="java";String str3=new String("java");StringBuffer str4=new StringBuffer("java");以下表达式的值为true的是( )

A. str1= =str2;
B. str1= =str4;
C. str2= =str3;
D. str3= =str4;

以下程序段输出结果的是( )public class Test {public static void main(String args[]){String str="ABCDE";str.substring(3);str.concat("XYZ");System.out.print(str);}}

A. DE
B. DEXYZ
C. ABCDE
D. CDEXYZ

对于下列代码:public class Example{String str=new String("hello");char ch[]={'d','b','c'};public static void main(String args[]){Example ex=new Example();ex.change(ex.str,ex.ch);System.out.println(ex.str+"and"+ex.ch[0]);}public void change(String str,char ch[]){str="world";ch[0]= 'a';}}输出结果是: ( )

A. hello and d
B. hello and a
C. world and d
D. world and a

以下代码的运行结果是哪一项。( )public class StringTest{public static void mb_operate(String x,String y){x.concat(y);y=x;}public static void main (String args[]){String a="A";String b="B";mb_operate(a,b);System.out.println(a+"."+b);}}

A.A
B.A
C. A.B
D. B.B

答案查题题库