单项选择题

设有如下程序: public class Sun { public static void main(String args[ ]) { int x,y; x=4; y=0; if(Math.pow(x,2)==16) y=x; if(Math.pow(x,2)<15) y=1/x; if(Math.pow(x,2)>15) y=(int)Math.pow(x,2)+1; System.out.println(y); } } 程序的运行结果是( )。

A.4
B.17
C.18
D.0.25
<上一题 目录 下一题>
热门 试题

单项选择题
有下面程序段: Public class ArrayTest { Public static void main(String args[]) { int[] intArray=new int[3]; for(int I=0;I<3;I++) { intArray[I]=I+2; System.out.println( IntArray[ +I+ ] = +intArray[I]); } System.out.println( -------------- ); Int arrLen=4; IntArray=new int[arrLen]; For(int j=intArray.length;j>=0;j--) { intArray[j]=j*3; System.out.println( hello +intArray[j]); } } } 则运行的结果是( )。
A.编译出错
B.编译通过,但运行出错
C.可以运行,但有错误
D.以上都不对
单项选择题
char类型被封装在( )中。
A.javlanInteger
B.javlanChar
C.javlanBoolean
D.javlanCharacter
相关试题
  • 以下各特点中属于算法的基本特征的是( )。
  • 下列关于线性表叙述中不正确的是( )。
  • 考虑一年四季的顺序关系时下列数据元素前者...
  • 下列命令中用于激活系统守候进程以便能够在...
  • 自定义的异常类可从下列哪个类继承 ( )