单项选择题
下列语句中变量result的结果为( )。 public class test public static void main(String args[ ]) int sum=10; int r=3; int result=sum %( ++r); System.out.println(result);
A.3
B.10
C.2
D.4
点击查看答案
<上一题
目录
下一题>
热门
试题
单项选择题
下列说法中错误的一项是 ( )
A) 实现完全串行化的类必须实现writeExternal()方法
B) readexternal()方法用于从对象流中读取通过writeExternal()方法写入的对象的数据
C) 实现完全串行化的类必须定义一个具有public访问权限的不带参数的构造方法
D) writeExternal()方法的访问权限是private
点击查看答案&解析
单项选择题
下面程序的输出结果是 public class Test public static void main(String[] args) int[]array=2,4,6,8,10; int size=6; int result=-1: try for(int i=0;i<size&&result==-1;i++) if(array[i]==20)result=i; catch(ArithmeticException e) System.out.println( Catch---1 ); catch(ArrayIndexOutOfBoundsException e) System.out.println( Catch---2 ); catch(Exception e) System.out.println( Catch---3 );
A) Catch---1 B) Catch一--2 C) Catch---3 D) 以下都不对
点击查看答案&解析
相关试题
在结构化方法中,用数据流程图(DFD)作为...
下面程序的输出结果是( )。 public cl...
关于异常,下列说法中正确的是( )。
AWT中用宋表示对话框的类是( )。
Java语言中属于跳转语句的是( )。