• 2022-06-09
    某个应用程序的main方法中有下面的语句,输出结果为( )String s="ABCD";s.concat("E");s.replace('C','F');System.out.println(s);
    A: ABCDEF
    B: ABFDE
    C: ABCDE
    D: ABCD
  • D

    内容

    • 0

      智慧职教: 下面程序段输出的结果是( )。 String s=”ABCD”; s.concat(“E”); s.replace(‘C’,’F’); System.out.println(s);

    • 1

      下面的哪些程序片断可能导致错误?( )。 A: String s="Gone with the wind";String t;t=s[3]+"one"; B: String s="Gone with the wind";String t="good";String k=s+t; C: String s="Gone with the wind";String standard=s.toUpperCase(); D: String s="home directory";String t=s-"directory";

    • 2

      以下选项能使 puts(s) 语句正确输出ABCDE字符串的程序段是__。 A: char s[5]={"ABCDE"}; puts(s); B: char s[5]={'A', 'B', 'C', 'D', 'E'}; puts(s); C: char *s; scanf("%s",s); puts(s); D: char *s; s="ABCDE"; puts(s);

    • 3

      下面语句中,正确的是( )。 A: printf("%c ","student"); B: printf("%c ","c"); C: printf("%s ",&a); D: printf("%s ","hello");

    • 4

      下列选项中正确的语句组是? char; s[8];; *s="Beijing";|char; s[8];; s={"Beijing"};;;|char; *s;; s="Beijing";|char; *s;; *s={"Beijing"};