String foo = “blue”; Boolean[]bar = new Boolean [1]; if (bar[0]) { foo = “green”; } What is the result? ()
相似题目
-
1.public class Test { 2.public static void main (String args[]) { 3.class Foo { 4.public int i = 3; 5.} 6.Object o = (Object) new Foo(); 7.Foo foo = (Foo)o; 8.System.out.printIn(foo. i); 9. } 10.} What is the result?()
-
int index = 1; String [] test = new String[3]; String foo = test[index]; What is the result?()
-
public class Foo { public void main (String [] args) { system.out.printIn(“Hello World.”); } } What is the result?()
-
public class Ball { public enum Color { RED, GREEN, BLUE }; public void foo() { // insert code here { System.out.println(c); } } } Which code inserted at line 14 causes the foo method to print RED, GREEN, and BLUE?()
-
3. string foo = “ABCDE”; 4. foo.substring(3); 5. foo.concat(“XYZ”); 6. Type the value of foo at line 6.()
-
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 Delta { static boolean foo(char c) { System.out.print(c); return true; } public static void main( String[] argv ) { int i =0; for ( foo(‘A’); foo(‘B’)&&(i<2); foo(‘C’)){ i++ ; foo(‘D’); } } } What is the result?()
-
3. string foo = “ABCDE”; 4. foo.substring(3); 5. foo.concat(“XYZ”); 6. Type the value of foo at line 6.()
-
String foo = “blue”; Booleanbar = new Boolean [1]; if (bar[0]) { foo = “green”; } What is the result?()
-
interface foo { int k = 0; } public class test implements Foo ( public static void main(String args) ( int i; Test test = new test (); i= test.k; i= Test.k; i= Foo.k; ) ) 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? ()
-
5. String foo = “base”; 6. foo.substring(0,3); 7. foo.concat(“ket”) 8. Type the value of foo at line 8.()
-
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?()
-
public class Test { public static void main (String args) { class Foo { public int i = 3; } Object o = (Object) new Foo(); Foo foo = (Foo)o; System.out.printIn(foo. i); } } What is the result?()
-
下面代码的运行结果为:( )import java.io.*;import java.util.*;public class foo{public static void main (String[] args){String s;System.out.println(s= + s);}}
-
读代码:public class Test {public static void main (String args[]) {class Foo {public int i = 3;}Object o = (Object) new Foo();Foo foo = (Foo)o;System.out.println(foo.i);}}结果是:
-
读代码:public class foo {static String s;public static void main (String[]args) {System.out.println (“s=” + s);}}结果是:
-
读代码:public class Test {public static void main (String [] args) {String foo = “blue”;String bar = foo;foo = “green”;System.out.println(bar);}}结果是:
-
publicclassDelta{staticbooleanfoo(charc){System.out.print(c);returntrue;}publicstaticvoidmain(String[]argv){inti=0;for(foo(‘A’);foo(‘B’)&&(i<2);foo(‘C’)){i++;foo(‘D’);}}}Whatistheresult?()
-
publicclassTest{publicstaticvoidmain(Stringargs){stringfoo=blue”;stringbar=foo;foo=green”;System.out.printIn(bar);}}Whatistheresult?()
-
下列程序运行后的输出结果是_public class Foo{ public static void main(String[] args){ String s; System.out.println(“s=” + s); }}()
-
给定以下程序段insert code public class foo {public static void main (String[] args) thro