下面程序段输出的结果是()。 String s="ABCD"; s.concat("E"); s.replace("C","F"); System.out.println(s);A.ABCDEFB.ABFDEC.ABCDED.ABCD

下面程序段输出的结果是()。 String s="ABCD"; s.concat("E"); s.replace("C","F"); System.out.println(s);

A.ABCDEF

B.ABFDE

C.ABCDE

D.ABCD


参考答案和解析
ABCD

相关考题:

下面程序段的运行结果是()。(注:└┘代表空格)include "stdio.h"main(){ char s[6]s="abcd"printf("\"%s\"\n", s)} A."abcd"B."abcd└┘"C.\"abcd\"D.编译出错

下面程序的输出结果是()publicclassTest{publicstaticvoidmain(String[]args){Strings=abcdsfghi”;String[]arr=s.split(\s”);System.out.println(arr.length);}} A.编译报错B.2C.1D.3

下列程序的运行结果是【 】。public class Test {public static void main (String args[]) {String s1="hello!";System.out.println (s1.toUpperCase());}}

下面程序执行后的输出结果为( )。 public class fun { public static void main(String args[]) { String greets="How are you!"; String s=greets.substring(0,3); System.out.println(S); } }A.HowB.are.C.youD.how ate you!

( 17 )阅读下面程序public class OperatorsAndExpressions {void equalsMethod1(){String s1=new String("how are you");String s2=new String("how are you");System.out.println(s1==s2);}public static void main(String args[]){OperatorsAndExpressions perAndExp=new OperatorsAndExpressions();// 用于复合类型数据的 “ == ” 运算符OperAndExp. equalsMethod1();}}程序运行结果是A ) ==B ) trueC ) falseD ) equal

下面程序段的输出结果为 public class MyClass { public static void main(String args[]) { String s="Helto! How are you?"; System.out.println(s.lastlndexOf("o",16)); } }A.16B.oC.uD.17

下面程序的输出结果是什么? class Foo{ static void change(String s){ s=s.replace('j','l'); } public static void main(String args[]){ String s="java"; change(s); System.out.println(s); } }()A.lavaB.javaC.编译错误D.运行时出现异常

下面程序段的输出结果是( )。 class Test{ public s,tatic void main(String args[]){ MyThread t=new MyThread; displayOutput("t has been createD"); start; } } Class MyThread extends Thread{ public void displayOutput(String s){ System.out.println(s); } public void run{ displayOutput("t is running."); } }A. t has been created.B.t has been created. t is running.C.t is running.D.编译出错

顺序执行下列两条语句,输出结果是______。String s="You are a pretty boy!";System.out.println(s.length( ));

下列程序段: String s1=new String("How"); String s2=new String("How"); System.out.println(!(s1==s2)); 的结果为A.falseB.trueC.1D.0

下面程序执行后的输出结果为( )。 public class fun { public static void main(String args[]) { String greets = " How are you!"; String s = greets.substring(0,3); System.out.println(s); } }A.HowB.areC.youD.how are you!

阅读下面程序 public class OperatorsAndExpressions{ void equalsMethodl(){ String s1=new String("how are you"); String s2=new String("how are you"); System.out.println(s1==s2); } public static void main(String args[]){ OperatorsAndExpressionsOperAndExp=new OperatorsAndExpressions(); //用于复合类型数据的“==”运算符 OperAndExp.equalsMethod1(); } } 程序运行结果是A.=B.trueC.falseD.equal

阅读下面程序 public class OperatorsAndExpressions { void equalsMethodl() { String s1=new String("how are you"); String s2=new String("how are you"); System.out.println(s1==s2); } public static void main(String args[]) { OperatorsAndExpressions perAndExp=new OperatorsAndExpressions(); //用于复合类型数据的“==”运算符 OperAndExp.equalsMethodl(); } } 程序运行的结果是A. ==B.trueC.falseD.equal

下面程序输出的结果是什么? ( ) public class Quiz2 { public static void main(String args[]) { try {throw new MyException(); }catch(Exception e) { System.out.println("It's caught!"); }finally{ System.out.println("It's finally caught!"); } } } class MyException extends Exception{}A.It's finally caught!B.It's caught!C.It's caught!/It's finally caught!D.无输出

若已包括头文件和,运行下列程序段时输出结果是()。int i=0;char s1[10]="ABCD 若已包括头文件<stdio.h>和<string.h>,运行下列程序段时输出结果是( )。 int i=0; char s1[10]="ABCD",s2[10]="EFG"; strcat(s1,S2); while(s2[i++]!='\0') s2[i]=s1[i]; puts(s2);A.ABCB.ABCDEFC.EBCDEFGD.CBD

若已包括头文件和,运行下列程序段时输出结果是()。 int i=0; char s1[10]="AB 若已包括头文件<stdio.h>和<string.h>,运行下列程序段时输出结果是( )。int i=0;char s1[10]="ABCD",s2[10]="EFG";Strcat(s1,S2) ;while(s2[i++]!='\0')s2[i]=s1[i];puts(s2);A.ABCB.ABCDEFC.EBCDEFGD.CBD

阅读下面程序 public class OperatorsAndExpressions { void equalsMethodl(){ String s1=new String("how are you"); String s2=new String("how are you"); System.out.println(s1==s2); } public static void main(String args[]){ OperatorsAndExpressions perAndExp=new OperatorsAndExpressions(); OperAndExp.equalsMethod1(); } } 程序运行结果是( )。A. ==B.trueC.假D.equal

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

下面程序的输出结果是( )。 char s()="ABCD",*p; main() { for(p=s;p<s+4;p++)printf("%s\n",p); )A.ABCD BCD CD DB.A B C DC.D C B AD.ABCD ABC AB A

下面程序的输出结果是( )。 public class Sun { public static void main(String args[]) { int[] a={1,2,3,4); int j=1,s=0; for(int i=3;i>=0;i--) { s=s+a[i]*j; j=j*10; } System.out.println(s); } }A.1234B.21C.43D.4321

下列程序的输出结果是( )。 public class Test { public static void main (String[] args) { String s="hello"; s.replace ('r','m'); System.out.println(s); } }A.helloB.HELLOC.hemmoD.HEMMO

设已执行预编译命令include,以下程序段的输出结果是()。char s[]="an apple";printf(" 设已执行预编译命令#include<string.h>,以下程序段的输出结果是( )。 char s[]=" an apple" ; printf(" %d\n" ,strlen(s));A.7B.8C.9D.10

下面程序输出的结果是什么? ( ) public class Quiz2 { public static void main(String args[]) { try {throw new MyException(); }catch(Exception e) { System.out.println("It's caught!"); }finally{ System.out.println("It's finally caught!"); } } } class MyExeeption extends Exception{}A.It's finally caught!B.It's caught!C.It's caught!/It'sfinally caught!D.无输出

下面程序的输出结果是() public class Test{  public static void main(String[] args){    String s = “abc dsf ghi”;  String[] arr = s.split(“/s”);   System.out.println(arr.length);  } }A、 编译报错B、 2C、 1D、 3

顺序执行以下两个语句的输出结果是:() 。 String s = "广东海洋大学"; System.out.println(s.length ));

设String对象s="H",运行语句System.out.println(s.concat("ello!"));后String对象s的内容为"Hello!",所以语句输出为"Hello!"。

判断题设String对象s="H",运行语句System.out.println(s.concat("ello!"));后String对象s的内容为"Hello!",所以语句输出为"Hello!"。A对B错

单选题下面程序的输出结果是() public class Test{  public static void main(String[] args){    String s = “abc dsf ghi”;  String[] arr = s.split(“/s”);   System.out.println(arr.length);  } }A 编译报错B 2C 1D 3