下列代码的执行结果是______。
public class Test
public static void main(String[]args)
int[]x=0,1,2,3;
forint i=0; i<3; 1+=2)
try
system. out. println(x[i+2]/x[i]+x[i+1]);
catch(ArithmeticException e)
System. out. println("errorl");
catch(Exception e)
System. out. println("error2");
A:errorl B:error2 C:errorl error2 D:2 error2
如果x为整数且|x|>=100,则打印“OK”,否则打印“Error”,表示这个条件的单行格式 If语句是
A:If Int((x)=x And Sqr(x)>=100 Then Print "OK" Else Print "Error" B:If Fix(x)=x And Abs(x)>=100 Then Print"OK"Else Print"Error" C:If Int(x)=x And (x>=100,x<=-100)Then Print"OK"Else Print"Error" D:If Fix(x)=x And x>=100 And x<=-100 Then Print "OK" Else Print "Error"
如果A为整数且|A|>=10,则打印“OK”,否则打印“Error”,表示这个条件的单行格式If语句是( )。
A:If Int(A)=A And Sqr(A)>=10 Then Print "OK" Else Print "Error" B:If Fix(a)=a And Abs(a)>=10 Then Print "OK" E1se Print "Error" C:If Iht(A)=A And(A>=10,A<=-10)Then Print "OK" Else Print "Error" D:If Fix(A)=A And A>=10,And A<=-10 Then Print "OK" Else Print "Error"
如果x为整数且|x| > = 100,则打印"OK",否则打印"Error",表示这个条件的单行格式If语句是________。
A:If Int(x)= x And Sqr(x)> = 100 Then Print "OK" Else Print "Error" B:If Fix (x)= x And Abs(x)> = 100 Then Print "OK" Else Print "Error" C:If Int(x)= x And (x > = 100, x < = -100)Then Print "OK" Else Print "Error" D:If Fix(x)= x And x > = 100 And x < = -100 Then Print "OK" Else Print "Error"
下列代码的执行结果是( )。
public class Test
public static void main(String[]args)
int[]x=0,1,2,3;
forint i=0;i<3;1+=2)
try
system.out.println(x[i+2]/x[i]+x[i+1]);
catch(ArithmeticException e)
System.out.println("error1");
catch(Exception e)
System.out.println("error2");
A:error1 B:error2 C:error1
orror2 D:2
error2
如果A为整数且|A|>=10,则打印“OK”,否则打印“Error”,表示这个条件的单行格式If语句是( )。
A:If Int(A)=A And Sqr(A)>=10 Then Print "OK" Else Print "Error" B:If Fix(=a And Abs(>=10 Then Print "OK" E1se Print "Error" C:If Iht(A)=A And(A>=10,A<=-10)Then Print "OK" Else Print "Error" D:If Fix(A)=A And A>=10,And A<=-10 Then Print "OK" Else Print "Error"
下列代码的执行结果是()public class Test { public static void main(String[] args) { int[] x={0,1,2,3}; for(int i=0;i<3;i+=2){ try{ System.out.println(x[i+2]/x[i]+x[i+1]); }catch(ArithmeticException e){ System.out.println("error1"); }catch(Exception e){ System.out.println("error2"); } } } }
A:error1 B:error2 C:error1 error2 D:2 error2
下列程序的运行结果是()
public class test
private String[] data="10","10.5";
public void fun( )
double s=0;
for(int i=0;i<3;i++)
try
s=s+Integer .parseInt(data[i]);
catch(Exception e)
System.out.print("error1:"+data[i]);
public static void main(String[]args)
try
testd=new test( );
d.fun( );
catch(Exception e)
System.out.printIn("error2");
A:error1:10.5 B:error2 C:error1:10.5 error2 D:以上都不对
下列代码的执行结果是()。
public class Test
public static void main(String[] args)
int[] x=0,1,2,3;
for(int i=0;i<3;i+=2)
try
System.out.println(x[i+2]/x[i]+x[i+1]);
catch(ArithmeticException e)
System.out.println("error1");
catch(Exception e)
System.out.println("error2");
A:error1 B:error2 C:error1 D:error2 E:2 F:error2
下列代码的执行结果是______。
public class Test
public static void main(String[]args)
int[]x=0, 1, 2, 3;
for(int i=0;i<3;i+=2)
try
System.out println(x[i+23/x[i]+x[i+1]);
catch(ArithmeticException e)
System.out.println("error1");
catch (Exception e)
System.out.println("error2");
A:error1 B:error2 C:error1 D:2
error2 error2