对于下列代码:public class Parent {public int addValue( int a, int b) {int s;s = a+b;return s;}}class Child extends Parent { }下述哪些方法可以加入类Child? ( )
A. int addValue( int a, int b ){// do something...}
B. public void addValue (int a, int b ){// do something...}
C. public int addValue( int a ){// do something...}
D. public int addValue( int a, int b )throws MyException {//do something...}
以下程序段:switch(m) {case 0: System.out.println("case 0");case 1: System.out.println("case 1"); break;case 2:default: System.out.println("default"); }m为0时程序的输出是( )
A. case 0
B. case 0 case 1
C. case 0default
D. case 0 case 1default
给出以下程序段:boolean m = true;if (m) System.out.println("False");else System.out.println("True");则运行结果为( )
A. False
B. True
C. None
D. 运行时出错
以下程序段执行时输入:java test则输出结果为( )public class test{public static void main(String args[]) {System.out.println(args[0]);}}
A. 无任何输出
B. 产生数组访问越界例外
C. 输出0
D. 输出test