多选题Which expressions will evaluate to true if preceded by the following code?()   String a = "hello";   String b = new String(a);   String c = a;   char[] d = { ’h’, ’e’, ’l’, ’l’, ’o’ };A(a == Hello)B(a == b)C(a == c)Da.equals(b)Ea.equals(d)

多选题
Which expressions will evaluate to true if preceded by the following code?()   String a = "hello";   String b = new String(a);   String c = a;   char[] d = { ’h’, ’e’, ’l’, ’l’, ’o’ };
A

(a == Hello)

B

(a == b)

C

(a == c)

D

a.equals(b)

E

a.equals(d)


参考解析

解析: 暂无解析

相关考题:

假设有以下代码: String s="hello"; String t="hello"; char c[ ]={'h','e','l','l','o'}; 下列选项中,返回false的语句是______。A.s.equals(t);B.t.equals(c);C.s==t;D.t.equals(new String("hello"));

给出下面的代码,则以下( )选项返回true。 String s="hello"; String t="hello"; Char c[]={'h','e','l','l','o'};A.s. equals (t) ;B.t. equals (C);C.s==t;D.t==c;

下列的哪个程序段可能导致错误? ( )A.String s="hello"; String t="good"; String k=s+t;B.String s="hello"; String t; t=s[3]+"one";C.String s="hello"; String standard=s.toUpperCase();D.String s="hello"; String t=s+"good";

下列哪个程序段可能导致错误?A.String s="hello"; String t= "good"; String k=s+ t;B.String s="hello"; String t; t=s[3]+"one";C.String s="hello"; String standard=s. toUpperCaseD.String s="hello"; String t =s+ "good"

给出下列的代码,则以下哪个选项返回true? String s="hello"; String t="hello"; char c []= {'h','e','1','1','o'};A)s.equals(t);A.t. equals(B.;C.s==t;D.t==c;

下面程序的输出结果是()。includeinclude"string.h"void main(){char a[]="Hello T 下面程序的输出结果是( )。 #include<iostream.h> #include"string.h" void main() {char a[]="Hello Test",b[]="Test"; strcpy(a,b); cout<<a<<end1; } A) B)C) D)A.HelloB.TestC.Hello TestD.Hello Test HelloTest

下列程序的输出结果是( )。 include include"string.h" void main() {char a[]="He 下列程序的输出结果是( )。 #include<iostream.h> #include"string.h" void main() {char a[]="Hello Test",b[]="Test"; strcpy(a,b); cout<<a<<end1; }A.HelloB.TestC.Hello TestD.Hello Test HelloTest

写出程序运行的结果Public class BasePublic virtual string Hello() {return “Base”;}Public class Sub:BasePublic override string Hello() {return “Sub”;}1. Base b = new Base(); b.Hello;2. Sub s = new Sub(); s.Hello;3. Base b = new Sub (); b.Hello;4. Sub s = new Base(); s.Hello;

下列代码段的执行结果是( )。 public class Test { public static void main(String args[ ]) { String s1= new String("hello"); String s2= new String("hello"); System.out.println(s1==s2); System.out.println(s1.equal(s2)); } }A.true falseB.true trueC.false trueD.false false

下列程序段的输出是( )。 public class Test { public static void main (String args[ ]) { String ss1 = new String("hello"); String ss2 = new String("hello"); System.out.println(ssl == ss2); System.out.println (ssequals(ss2)); } }A.true, falseB.true, trueC.false, trueD.false, false

下列代码的执行结果是______。 public class ex55 { public static void main(String args[] ) { String s1=new String("hello"); String s2=new String("hello"); System.out.print (s1==s2); System.out.print (","); System.out.println (s1.equals (s2)); } }A.true, falseB.true, trueC.false, trueD.false, false

给出下列的代码则以下哪个选项返回true? String s = "hello" ; String s = "hello" ; char c[] = { 'h' ,'e','l','o'};A.s.equals(t);B.t.equals(c);C.s = =tD.t = = c;

下列的( )程序段可能导致错误。A.String s="hello": Sting t="good"; String k=s+t;B.Sting s="hello"; String t; t=s [3] + "one";C.Sting s="hello"; String standard=s.toUpperCase( );D.String s="hello": Stringt s +"good";

下列的哪个程序段可能导致错误?A.String s = "hello"; String t = "good"; String k = s + t;B.String s = "hello"; String t; t = s[3] + "one";C.String s = " hello "; String standard = s.toUpperCase( );D.String s = "hello"; String t = s + "good";

给出下面程序: public class ex51 { public static void main(String[] args) { String s = "hello"; String t = "hello"; char c[] = {'h', 'e', '1', '1', 'o'}; System. out. println (______) } } 在程序的横线处填入下列______选项后,程序输出的结果是true。A.t.equals(c)B.s.equals?C.s == tD.t == c

Which expressions will evaluate to true if preceded by the following code?()   String a = "hello";   String b = new String(a);   String c = a;   char[] d = { ’h’, ’e’, ’l’, ’l’, ’o’ };  A、(a == "Hello")B、(a == b)C、(a == c)D、a.equals(b)E、a.equals(d)

String s= "hello";     String t = "hello";  char c[] = {’h’,’e’,’l’,’l’,’o’} ;     Which return true?()   A、 s.equals(t);B、 t.equals(c);C、 s==t;D、 t.equals(new String("hello"));E、 t==c;

Which expressions are correct to declare an array of 10 String objects? ()   A、 char str[];B、 char str[][];C、 String str[];D、 String str[10];

public class X {   public static void main (String[]args)   {   string s = new string (“Hello”);   modify(s);   System.out.printIn(s);   }   public static void modify (String s)  {   s += “world!”;      }   }      What is the result?()    A、 The program runs and prints “Hello”B、 An error causes compilation to fail.C、 The program runs and prints “Hello world!”D、 The program runs but aborts with an exception.

public class X {   public static void main (Stringargs) {   string s = new string (“Hello”);   modify(s);   System.out.printIn(s);   }   public static void modify (String s) {   s += “world!”;   }   }   What is the result?() A、The program runs and prints “Hello”B、An error causes compilation to fail.C、The program runs and prints “Hello world!”D、The program runs but aborts with an exception.

Consider the following class:     class Test(int i) {     void test(int i) {  System.out.println(“I am an int.”); }    void test(String s) {   System.out.println(“I am a string.”);     }          public static void main(String args) {    Test t=new Test();     char ch=“y”;    t.test(ch);     }      }     Which of the statements below is true?()A、 Line 5 will not compile, because void methods cannot be overridden.B、 Line 12 will not compile, because there is no version of test() that rakes a charargument.C、 The code will compile but will throw an exception at line 12.D、 The code will compile and produce the following output: I am an int.E、 The code will compile and produce the following output: I am a String.

Which is the earliest line in the following code after which the object created on the line marked (0) will be a candidate for being garbage collected, assuming no compiler optimizations are done? ()  public class Q76a9 {   static String f() {   String a = "hello";   String b = "bye"; // (0)   String c = b + "!"; // (1)   String d = b;  b = a; // (2)   d = a; // (3)   return c; // (4)  }   public static void main(String args[]) {   String msg = f();   System.out.println(msg); // (5)   }   }  A、The line marked (1).B、The line marked (2).C、The line marked (3).D、The line marked (4).E、The line marked (5).

下列哪项是String的字面量?() A、“Hello”B、‘world’C、/u2345D、new String(“good”)

单选题public class X {   public static void main (String[]args)   {   string s = new string (“Hello”);   modify(s);   System.out.printIn(s);   }   public static void modify (String s)  {   s += “world!”;      }   }      What is the result?()A The program runs and prints “Hello”B An error causes compilation to fail.C The program runs and prints “Hello world!”D The program runs but aborts with an exception.

单选题Which expressions are correct to declare an array of 10 String objects? ()A char str[];B char str[][];C String str[];D String str[10];

单选题Which is the earliest line in the following code after which the object created on the line marked (0) will be a candidate for being garbage collected, assuming no compiler optimizations are done? ()  public class Q76a9 {   static String f() {   String a = "hello";   String b = "bye"; // (0)   String c = b + "!"; // (1)   String d = b;  b = a; // (2)   d = a; // (3)   return c; // (4)  }   public static void main(String args[]) {   String msg = f();   System.out.println(msg); // (5)   }   }AThe line marked (1).BThe line marked (2).CThe line marked (3).DThe line marked (4).EThe line marked (5).

多选题String s= "hello";     String t = "hello";  char c[] = {’h’,’e’,’l’,’l’,’o’} ;     Which return true?()As.equals(t);Bt.equals(c);Cs==t;Dt.equals(new String(hello));Et==c;