执行以下代码会输出什么结果?() 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”)); } }
int index = 1; String [] test = new String[3]; String foo = test[index]; What is the result?()
1. interface TestA { String toString(); } 2. public class Test { 3. public static void main(String[] args) { 4. System.out.println(new TestA() { 5. public String toString() { return “test”; } 6. } 7. } 8. } What is the result?()
连续执行命令test“string1”=“string2”echo$?则最后的输出结果是()
public class Test { public static void main (String args) { string foo = “blue”; string bar = foo; foo = “green”; System.out.printIn(bar); } } What is the result?()
public class Test { public static void main(String[] args) { String str = NULL; System.out.println(str); } } What is the result?()
public class test( public static void main(stringargs){ string foo = args [1]; string foo = args ; string foo = args ; } ) And command line invocation: Java Test red green blue What is the result? ()
11. String test = “This is a test”; 12. String[] tokens = test.split(”\s”); 13. System.out.println(tokens.length); What is the result?()
Given: 11.String test = "This is a test"; 12.String[] tokens = test.split("\s"); 13.System.out.println(tokens.length); What is the result?()
int index = 1; String test = new String; String foo = test[index]; What is the result?()
public class Test { public static void main (String [] args) { string foo = “blue”; string bar = foo; foo = “green”; System.out.printIn(bar); } } What is the result?()
public class test( public static void main(string[]args){ string foo = args [1]; string foo = args [2]; string foo = args [3]; } ) And command line invocation: Java Test red green blue What is the result?()
Given: 11.String test = "Test A. Test B. Test C."; 12.// insert code here 13.String[] result = test.split(regex); Which regular expression, inserted at line 12,correctly splits test into "Test A","Test B",and "Test C"?()
1. public class test ( 2. public static void main(string args[]) { 3. int 1= 0; 4. while (i) { 5. if (i==4) { 6. break; 7. } 8. ++i; 9. } 10. 11. } 12. ) What is the value of i at line 10?()
执行以下代码,输出结果的结果是? () public class Test{ public String[] ss = new String[5]; public static void main(String[] args){ System.out.println(ss[1]); } }
Given: 11.String test = "a1b2c3"; 12.String[] tokens = test.split("\\d"); 13.for(String s: tokens) System.out.print(s + " "); What is the result?()
public class Test {public int call(){static int i=0;i++;System.out.println(i);}public static void main(String args[]){Test test = new Test();test.call();}}
有以下代码:package com;public class Test {public static void main(String[] args) {Test test = new Test();//here}}在here处加上以下什么语句,可以获得Class对象?(多选)
读代码:public class Test {public static void main (String [] args) {String foo = “blue”;String bar = foo;foo = “green”;System.out.println(bar);}}结果是:
分析如下所示的Java代码,则选项中的说法正确的是( )。 class Parent{ public String name; public Parent(String pName){ this.name = pName; } } public class Test extends Parent { //1 public Test(String Name){ //2 name=\hello
下列程序输出结果为()。 public class test { public static void main (String args[]) {
下列语句输出结果为()。 public class test{ public static void main(String args[]) String s1
关于下面的程序Test.java说法正确的是()。public class Test {String x="1";int y;
类Test定义如下:class Test public static void main(string args) String s1="abc";String s2=new String(s1);if(s1==s2) System.out.println("s1==s2";if(s1.equals(s2)) System.out.println("s1.equals(s2)"); 那么程序的执行