• 2022-06-08
    给出下列的程序段,则哪个选项返回true ( ) String s="hello"; String t="hello"; char c[]={'h','e','l','l','o'};
    A: equals(;
    B: Lequals(;
    C: s==t;
    D: t==c;
  • A

    内容

    • 0

      String s=new String(“hello”); String t =new String(“hello”); char c [ ] ={‘h’,’e’,’l’,’l’,’o’}; 下列哪些表达式返回true ?

    • 1

      String s=new String(“hello”);String t =new String(“hello”);char c [ ] ={‘h’,’e’,’l’,’l’,’o’};下列哪些表达式返回true ? A: s.equals(t); B: t.equals(c); C: s= =t ; D: t.equals (new String(“hello”));

    • 2

      String s=”hello”;String t=”hello”;String e=new String(”hello”) ;char c[]={„h‟,e‟,‟l‟,‟l‟,o‟};给定如上Java代码,编译运行时,以下( )语句的值是true。 A: s.equals(t) B: t.equals(c) C: t== e D: t==c

    • 3

      给出下列的代码,则以下哪个选项返回true String s = "hello"; String t = "hello"; char c[ ] = {''h'',''e'',''l'',''l'',''o''}; A: Sub Pro4 (x As Form) B: Sub Pro4 (y As Control) C: Sub Pro4 (Forml As Form,Labell As Control) D: Sub Pro4 (x As Currency)

    • 4

      给定如下java代码,编译运行时,以下()语句的值是trueString s="hello";String t="hello";String e=new String("hello");char c[]={"h","e","l","l","0"}; A: s.equals(t); B: t.equals(c); C: t.equals(e); D: t==c