• 2022-06-07
    运行下面程序段的结果是:( )。 public class MyMain{ public static void main(String args){ System.out.println(“Hello Java”); } }
  • 编译时出错

    内容

    • 0

      (2-6)请写出下面程序运行结果。 public class Demo { public static void main(String[] args) { int b = 011001; System.out.println(b); } }

    • 1

      中国大学MOOC: 下列代码中构造方法的返回类型是()public class Village { Village () { System .out .println(“hiding in Village”) ; } public static void main( String args [ ]) { Village c =new Village ( ) ;}class Village { public static void main( String args [ ]) { Village c =new Village ( ) ; } Village () { System .out .println(“hiding in Village”) ; } }

    • 2

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

    • 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 ChangeStrDemo { public static void changeStr(String str){ str="welcome"; } public static void main(String[] args) { String str="home"; changeStr(str); System.out.println(str); } }给出程序的运行结果( )