题目内容

将以下哪种方法插入到第6行是不合法的( ) 。1.public class Test1 { 2. public float aMethod(float a,float b) throws 3. IOException { } 4. } 5.public class Test2 extends Test1{ 6. 7.}

A. float aMethod(float a,float b){ }
B. public int aMethod(int a,int b)throws Exception{ }
C. public float aMethod(float p,float q){ }
D. public int aMethod(int a,int b)throws IOException{ }

查看答案
更多问题

public class Example25 { public static void main(String[] args) { int[] arr = new int[4]; // 定义一个长度为4的数组 System.out.println("arr[0]=" + arr[4]); // 通过索引4访问数组元素 }}这个例子在执行的时候会错吗?

A. 错误
B. 不会错误

分析下面的Java代码,输出的结果为( )。int i=0;for(;i<4;i+=2){ System.out.print (i+",");}System.out.println (i);

A. 0,2
B. 0,2,4
C. 0,2,4,6
D. 0,1,2,3

如果有以下关于变量赋值的程序代码:float radius = 88.2; double area= 3.14 * radius * radius; System.out.println(area);

A. 执行时显示48853.6272
B. 执行时显示48853
C. 执行时出现错误
D. 编译失败

下列赋值语句错误的是( )

A. String name = "gaojing";
B. boolean a = true;
C. float f = 123.45;
D. int i = 2;

答案查题题库