• 2022-06-04
    写出下面程序的运行结果 【15】 import java.io.*; public class abc public static void main(String args[]) String s1="Hello!"; String s2=new String("World!"); System.out.println(s1.concat(s2));
  • Hello! World!

    内容

    • 0

      下列程序的运行结果是 ______ 。 import java.io.*; public class abc public static void main(String args[]) String s1="Hello!”; System.out.println(s1.to UpperCase());

    • 1

      下面程序代码运行结果为( )。 import java.awt.*; public class Test { public static void main (String args[]) { String s1="a+b+c"; String s2="+"; int i=s1.lastIndexOf (s2); System.out.println(i); } } A: 0 B: 1 C: 2 D: 3

    • 2

      下列语句输出结果为( )。public class test{public static void main(String args []){String s1=new String("How");String s2=new String("How");System.out. println(!(s1 ==s2));} A: false B: true C: 1 D: 0

    • 3

      读代码:public class foo {static String s;public static void main (String[]args) {System.out.println (“s=” + s);}}结果是

    • 4

      中国大学MOOC: 运行以下代码:public class StringRef{public static void main(String[] args){ String s1=”abc”; String s2=”def”; String s3=s2; s2=”ghi”; System.out.println(s1+s2+s3);}}运行结果是( )。