• 2021-04-14
    中国大学MOOC: 运行以下代码:public class SqrtExample{public static void main(String[] args){ double value=-9.0; System.out.println(Math.sqrt(value)); }}运行结果是( )。
  • NaN

    内容

    • 0

      中国大学MOOC: 下列程序的运行结果是______。public class Person {static int arr[ ]=new int[10];public static void main(String args ) { System.out.println(arr[9]);}}

    • 1

      下面代码的运行结果为:( ) import java.io.*; import java.util.*; public class foo{ public static void main (String[] args){ String s; System.out.println("s=" + s); } }

    • 2

      给定如下java 代码,在下划线处填入( ),代表HelloWorld 类具有main方法,可以独立运行。public class Helloworld { _______{ System.out.println( “ hello world” ) ; } } A: public static void main( String args ) B: static void main( String args[ ] ) C: public static void main( String[ ] strs ) D: public static main( String args[ ] )

    • 3

      下列程序运行结果是 public class Demo { public static void main(String[] args) { Object obj=new Father(){ public void show(){ System.out.println("helloworld"); } }; obj.show(); } } class Father{ public void show(){ System.out.println("hello father"); } }

    • 4

      下列程序的运行结果是()public class Test {public static void main(String[] args) {String str = NULL;System.out.println(str);}} A: