网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

执行下列代码后,()结论是正确的。 String[]s=newString[10];

  • A、s[10]为"";
  • B、s[9]为null;
  • C、s[0]为未定义
  • D、s.length为10

参考答案

更多 “执行下列代码后,()结论是正确的。 String[]s=newString[10];A、s[10]为"";B、s[9]为null;C、s[0]为未定义D、s.length为10” 相关考题
考题 如果String s1=“Chongqing”,则运行代码String s3=s1.substring(2,4)后s3的值为() A、honB、hoC、onD、ngq

考题 假设有以下代码: 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"));

考题 执行下列代码后,哪个结论是正确的String[]s=newString[10];()A、s[10]为““;B、s[9]为null;C、s[0]为未定义D、s.length为10

考题 执行下列代码后,哪个结论是正确的String[]s=newString[10];()A、[10]为"";B、[9]为null;C、[0]为未定义D、lengtH为10

考题 下列程序执行后,字符串s应是 String greets="hello"; String s=greets.substring(0,3);A.elloB.hellC.helloD.hl

考题 下列代码的执行结果是 ( )public class Test2{public static void main(String args[]){int a=4,b=6,c=8;String s="abc";System.out.println(a+b+s+c);}}A.ababccB.464688C.46abc8D.10abc8

考题 下列程序的执行结果是______。 public class Test9 { public static void main(String[] args) { String s1 = new String("I am a girl"); String s2 = new String("I am a girl"); System.out.println (s1.equal (s2)); } }A.trueB.假C.I amgirlD.都不正确

考题 下列程序的执行结果是 public class Testff{ public static void main(String args[]){ String sl=new String("I am boy"); String s2=new String("I am boy"); System.out.println(sl==s2); } }A.真B.假C.I am boyD.都不正确

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

考题 下列代码的执行结果是( )。 public class Test { public static void main (String args[]) { int a=3,b=5,c=8; String s="abc"; System.out.println(a+b+s+c); } }A.35abc8B.8abc8C.16D.abc

考题 String s = "Hello";s = s + " world!";这两行代码执行后,原始的String 对象中的内容到底变了没有?

考题 下列代码的执行结果是( )。 public class test4{ public smile void main(string args[]){ int a=4,b=6,c=8; String s="abc"; Sy stem.out.println(a+b+s+e); System.out.pfinfin(); } }A.ababccB.464688C.46abc8D.10abc8

考题 下列程序执行后,屏幕上显示的应是 public class Testyyy {public static void main(String[]args) {char charl[]={,'t' 'e''s],'t'}; char char2[]={'t','e','s','t','1'}; String s1=new String(char1); String s2=new String(char2,0,4); System.out.println(s1.equals(s2)); } }A.trueB.假C.testD.编译错误

考题 下列代码段的执行结果是( )。 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

考题 关于以下代码段的说法正确的是( )。 (1) String s="abcde"; (2) String Buffer s1=new String Buffer("abcde"); (3) if(s.equals(s1)) (4) s1=null: (5) if(s1.equals(s)) (6) s=null;A.第(1)行编译错误,String的构造器必须明确调用B.第(3)行编译错误,因为s与s1有不同的类型C.编译成功,但执行时在第(5)行有异常抛出D.编译成功,执行过程中也没有异常抛出

考题 下列代码的执行结果是______。 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;

考题 下列代码的执行结果是( )。 public class Test { public static void main(String args[ ]) { int a =4,b=6,c=8; String s ="abc"; System.out.println(a+b+s+c); System.out.println(); } }A.ababccB.464688C.46abc8D.10abc8

考题 执行String[] s=new String[10]后,哪个结论是正确的? ( )A.s[10]为""B.s[9]为nullC.s[0]为未定义D.s.length为101

考题 执行下列两条语句后,结果s2的值为()    string s=“abcdefgh”;      string s2=s.Substring(2,3);A、 “bc”B、 “cd”C、 “bcd”D、 “cde”

考题 下面哪段语法执行正确()A、 String s = "Gone with the wind";String t = " good ";String k = s + t;B、 String s = "Gone with the wind";String t; t = s[3] + "one";C、 String s = "Gone with the wind";String standard = s.toUpperCase();D、 String s = "home directory";String t = s - "directory";

考题 执行以下代码后,下面哪些描述是正确的() public  class  Student{  private String name = “Jema”;  public void setName(String name){  this.name = name;  }  public String getName(){  return this.name;  }  public static void main(String[] args){  Student s;  System.out.println(s.getName()); } }A、输出nullB、第10行编译报错C、第11行编译报错D、输出Jema

考题 执行代码Strings=newString("Hello")后,正确的结论是()A、s最后一个索引值为5B、s的值和"Hello"并不一样C、s.length为4D、s.length为5

考题 多选题执行下列代码后,()结论是正确的。 String[]s=newString[10];As[10]为;Bs[9]为null;Cs[0]为未定义Ds.length为10

考题 单选题执行下列两条语句后,结果s2的值为()    string s=“abcdefgh”;      string s2=s.Substring(2,3);A  “bc”B  “cd”C  “bcd”D  “cde”

考题 多选题下面哪段语法执行正确()AString s = Gone with the wind;String t =  good ;String k = s + t;BString s = Gone with the wind;String t; t = s[3] + one;CString s = Gone with the wind;String standard = s.toUpperCase();DString s = home directory;String t = s - directory;

考题 单选题执行以下代码后,下面哪些描述是正确的() public  class  Student{  private String name = “Jema”;  public void setName(String name){  this.name = name;  }  public String getName(){  return this.name;  }  public static void main(String[] args){  Student s;  System.out.println(s.getName()); } }A 输出nullB 第10行编译报错C 第11行编译报错D 输出Jema