public class Foo {   public void main (String args) {   syst

题目
单选题
public class Foo {   public void main (String args) {   system.out.printIn(“Hello World.”);   }   }   What is the result? ()
A

 An exception is thrown.

B

 The code does no compile.

C

 “Hello World.” Is printed to the terminal.

D

 The program exits without printing anything.

如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

以下是JAVA中正确的入口方法是? () 

  • A、 public static void main(String[] args){}
  • B、 public static void main(String args){}
  • C、 public void main(String[] args){}
  • D、 public static int main(String[] args){}

正确答案:A

第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?()  

  • A、 An exception is thrown.
  • B、 The code will not compile.
  • C、 The program prints “null”
  • D、 The program prints “blue”
  • E、 The program prints “green”

正确答案:D

第3题:

以下Java应用程序执行入口main方法的声明中,正确的是( )。

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)


参考答案:B

第4题:

Public class test (  Public static void main (String args[])  (  System.out.printIn (6 ^ 3);  )  )   What is the output?()


正确答案:5

第5题:

public class Foo {  public void main( String[] args ) {  System.out.println( “Hello” + args[0] );  }  }   What is the result if this code is executed with the command line?()

  • A、 Hello
  • B、 Hello Foo
  • C、 Hello world
  • D、 Compilation fails.
  • E、 The code does not run.

正确答案:E

第6题:

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?()  

  • A、 Baz has the value of “”
  • B、 Baz has the value of null
  • C、 Baz has the value of “red”
  • D、 Baz has the value of “blue”
  • E、 Bax has the value of “green”
  • F、 The program throws an exception.

正确答案:F

第7题:

Which declarations will allow a class to be started as a standalone program?()  

  • A、public void main(String args[])
  • B、public void static main(String args[])
  • C、public static main(String[] argv)
  • D、final public static void main(String [] array)
  • E、public static void main(String args[])

正确答案:D,E

第8题:

以下哪个是Java应用程序main方法的有效定义?

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[] );


正确答案:C

第9题:

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?() 

  • A、 foofoofoofoofoo
  • B、 foobarfoobarbar
  • C、 foobarfoofoofoo
  • D、 foobarfoobarfoo
  • E、 barbarbarbarbar
  • F、 foofoofoobarbar
  • G、 foofoofoobarfoo

正确答案:D

第10题:

下列有关main()方法的签名正确的是哪些?()

  • A、 public static void main(String[] args){}
  • B、 public static void main(){}
  • C、 public static void main(String args[]){}
  • D、 public void static main(String[] args){}

正确答案:A,C

更多相关问题