The code compiles and “s=” is printed.
The code compiles and “s=null” is printed.
The code does not compile because string s is not initialized.
The code does not compile because string s cannot be referenced.
The code compiles, but a NullPointerException is thrown when toString is called.
第1题:
以下是JAVA中正确的入口方法是? ()
第2题:
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?()
第3题:
public class Base { public static final String FOO = “foo”; public static void main(String[] args) { Base b = new Base(); Sub s = new Sub(); System.out.print(Base.FOO); System.out.print(Sub.FOO); System.out.print(b.FOO); System.out.print(s.FOO); System.out.print(((Base)s).FOO); } } class Sub extends Base {public static final String FOO=bar;} What is the result?()
第4题:
下列有关main()方法的签名正确的是哪些?()
第5题:
作为Java应用程序入口的main方法,其声明格式可以是()。
第6题:
public class Test { public static void main( String[] args) { String foo = args[1]; String bar = args[2]; String baz = args[3]; System.out.println(“baz = “ + baz); } } And the command line invocation: java Test red green blue What is the result?()
第7题:
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(“i = “ + foo.i); } } What is the result?()
第8题:
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? ()
第9题:
Baz has the value of “”
Baz has the value of null
Baz has the value of “red”
Baz has the value of “blue”
Bax has the value of “green”
The program throws an exception.
第10题:
Baz has the value of “”
Baz has the value of null
Baz has the value of “red”
Baz has the value of “blue”
Bax has the value of “green”
The program throws an exception.
第11题:
i = 3
Compilation fails.
A ClassCastException is thrown at line 6.
A ClassCastException is thrown at line 7.
第12题:
foofoofoofoofoo
foobarfoobarbar
foobarfoofoofoo
foobarfoobarfoo
barbarbarbarbar
foofoofoobarbar
foofoofoobarfoo
第13题:
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?()
第14题:
Which declarations will allow a class to be started as a standalone program?()
第15题:
Public class test ( Public static void main (String args[]) ( System.out.printIn (6 ^ 3); ) ) What is the output?()
第16题:
下面哪些选项是正确的main方法说明?()
第17题:
声明Java独立应用程序main()方法时,正确表达是()。
第18题:
public class Foo { static int[] a; static { a[0]=2; } public static void main( String[] args) {} } Which exception or error will be thrown when a programmer attempts to run this code?()
第19题:
public class Foo { public static void main(String[] args) { try { return; } finally { System.out.println( “Finally” ); } } } What is the result?()
第20题:
下面哪些main方法可用于程序执行()
第21题:
public void main(String args[])
public void static main(String args[])
public static main(String[] argv)
final public static void main(String [] array)
public static void main(String args[])
第22题:
An exception is thrown.
The code will not compile.
The program prints “null”
The program prints “blue”
The program prints “green”
第23题:
public static void main(String[] args){}
public static void main(String args){}
public void main(String[] args){}
public static int main(String[] args){}
第24题:
public main(String args[])
public static void main(String args[])
private static void main(String args[])
void main()