【单选题】下列哪行代码有错误? 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("您好");
A. public class Example 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”) ; } }
- 下列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("您好");
- 读代码:public class foo {static String s;public static void main (String[]args) {System.out.println (“s=” + s);}}结果是
- public class Example { public static void main(String[] args) { new Father () { public void show() { System.out.println("helloworld"); } }.show(); } } class Father { public void show() { System.out.println("hellofather"); } }
- 阅读下列的程序 public class Example { public static void main(String[] args) { new Father () { public void show() { System.out.println("helloworld"); } }.show(); } } class Father { public void show() { System.out.println("hellofather"); } } A. B. C. D.