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题:
下列( )是对main ()主方法的正确表示。
A.public void static main (String args []) {…}
B.void public static main (String args []) {…}
C.static public void main (String args []) {…}
D.以上都不正确
第2题:
以下是JAVA中正确的入口方法是? ()
第3题:
A.public static void main()
B.public static void main(String[] args)
C.public static int main(String[] args)
D.public void main(String[] args)
第4题:
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?()
第5题:
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?()
第6题:
A. public static void main();
B. public static void main( String args );
C. public static void main( String args[] );
D. public static void main( Graphics g );
E. public static boolean main( String a[] );
第7题:
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?()
第8题:
下列哪个是对main( )主方法的正确表示?
A.public void static main(String args[ ]){ ... }
B.void public static main(String args[ ]){ ... }
C.static public void main(String args[ ]){ ... }
D.以上都不正确
第9题:
Which declarations will allow a class to be started as a standalone program?()
第10题:
Public class test ( Public static void main (String args[]) ( System.out.printIn (6 ^ 3); ) ) What is the output?()