下列ABCD注释标注的哪行代码有错public class Demo { public static void main(String args[]) { System.out.println("Java"); system.out.println("hello"); System.out.println("你好"); } }
A: public class Demo
B: public static void main(String args[])
C: system.out.println("ok");
D: System.out.println("您好");
A: public class Demo
B: public static void main(String args[])
C: system.out.println("ok");
D: System.out.println("您好");
举一反三
- 中国大学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”) ; } }
- 【单选题】下列哪行代码有错误? public class Example{ public static void main(String args[]){ System.out.println("ok"); system.out.println("您好"); } } A. public class Example B. public static void main(String args[]) C. System.out.println("ok"); D. system.out.println("您好");
- (2-5)写出下面程序运行结果。 public class Demo { public static void main(String args[]) { System.out.println(123); System.out.println(0123); System.out.println(0x123); } }
- 下列程序运行结果是 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"); } }
- class Person{ static{ System.out.println(name); } private static String name = "hello"; } class Demo{ public static void main(String[] args){ Person p = null; } }