执行以下代码会输出什么结果?() public class Test { StringgetStr(String s){ return s + “hello”; } public static void main(String arg[]) { Test t= new Test(); System.out.println(t.getStr(“LiLei\n”)); } }
现有代码片段: String s="123"; String sl=S+456; 请问sl的结果是哪项?()
类Student代码如下: class Student{ String name; int age; Student(String nm){ name = nm; } } 执行语句Student stu = new Student()后,字段age的值是哪项?()
现有: class A {public String name="a"} class B extends A {public String name="b"} 执行如下代码后的结果是哪项?() A a=new B(); System.out.println(a.name);
类Student代码如下:D class Student{ String name; int age; Student(String nm){ (构造方法) name = nm; } } 执行语句Student stu = new Student()后,字段age的值是哪项?()
class MyApp{ public static void main(String[] args){ int age; System.out.println(“age=”+age); } } 执行上述代码后输出的结果是哪项?()
设有如下代码: int[] x = new int[25]; 执行后,以下哪个说法正确?
已知代码: String s = story
读代码:public class foo {static String s;public static void main (String[]args) {System.out.println (“s=” + s);}}结果是:
对于如下代码,下列哪个叙述是正确的?public class E {public static void main (String args[]) {String s1 = args[1];String s2 = args[2];String s3 = args[3];System.out.println(s3);}}
执行下列代码后,哪个结论是正确的 String[] s=new String[10];
现有代码片段:String s=\123
如下这段代码执行后,字符串s的值是________?String s=”hello”;s.concat(“mrs”);s.toUpperCase();s+=” there”;
以下是关于字符串运算的代码,执行该代码段的输出结果是( )String s=″0123456789″,sl,s2;sl=s.substring(2);s2=s.substring(2,5);System.out.println(s1+s2);
执行下面代码后,( )结论是正确的. String[] s=new String[10];
请阅读下面的代码class A{int x;static int y;void fac(String s){System.out.println(“字符串:”+s);}}下列选项中描述正确的是()
执行下面语句后,输出结果是()String s=""hello,World!"";System.out.println(s.length()); A、12B、14C、16D、18
下列的哪个程序段可能导致错误?()A.String s="hello"; String t="good"; String k=s+t;B.String
给出下面代码: public class Person{ static int arr[] = new int[10];public static void main(String a[]) {System.out.println(arr[1]); } } 哪个语句是正确的()。
执行”String[] s = new String[10];”语句后,结论正确的是()
StringBuffer str=new StringBuffer(25);String s=”Hello”,若执行语句str.append(s)后,str.length()和str.capacity()的返回值为()。
下面的代码输出结果是什么?string s{“”};s.append(“ABCDEFG”, 3, 2);cout << s;()
对于下列代码,下列哪个叙述是正确的()? class A{ public int i=0; A(int m){ i=1; } } public class B extends A{ B(int m){ i=2; } public static void main(String args[]){ B b=new B(100); System.out.println(b.i); //【代码】 } }
假设有以下代码:String s="hello";String t="hello";char c[ ]={"h","e","l","l","o"}; 下列选项中,返回false的语句是______。