A.(a=="Hello")
B.(a==b)
C.(a==c)
D.a.equals(b)
E.a.equals(d)
第1题:
下面各语句行中,能正确进行字符串赋值操作的语句是:
A.char *s;scanf("%s",s);
B.char st[4][5]={"HELLO"};
C.char s[5]={'H', 'E', 'L', 'L', 'O'};
D.char * s;s="HELLO";
第2题:
下列代码的输出结果是什么? public static void main(String[] args) { String a = "110"; String b = "110"; String c = new String("110"); String d = new String(a); System.out.println(a == b); System.out.println(a == c); System.out.println(c == d); }
A.true false false
B.true true true
C.true true false
D.编译错误
第3题:
下列初始化字符数组的语句,正确的是()。
A.char[] str = {'h', 'e', 'l', 'l', 'o'};
B.char[5] str = "hello";
C.char[5] str = {"hi"};
D.char[100] str = "";
第4题:
【单选题】8.7 若有以下程序代码,则程序运行结果正确的是() public class DemoMain { public static void main(String []s){ String a = new String("hello"); String b = new String("hello"); String c = "hello"; String d = a; System.out.print((a==d)+" "+(a==b)+" "+(a==c)); } }
A.true false true
B.true false false
C.true true false
D.false true true
第5题:
下面这些代码的功能是创建一个string对象 s,并将其内容设置为字符串 alohaworld ,正确的有:
A.string s{'alohaworld'};
B.string s = string{"alohaworld"};
C.char* p = "alohaworld"; string s(p);
D.string s{'a','l','o','h','a','w','o','r','l','d'};
E.string s('a','l','o','h','a','w','o','r','l','d');