单项选择题

下列程序的运行结果是( )。
Public class sun

Public static void main(String args[])

int 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 Test public static void main(String args[]) int a,b; for(a=1,b=1;a<=100;a++) if(b>=10)break; if(b%2==1) b+=2; continue; System.out.println(a);
A.5
B.6
C.7
D.101
单项选择题
下面程序段的输出结果为( )。 public class Test public static void main(String args[]) booleana,b,c; a=(3<5); b=(a==true); System.out.println( a= +a+ b= +b); c=(b==false); System.out.println( b= +b+ c= +c);
A.a=true b=false
b=true c=true
B.a=true b=false
b=true c=false
C.a=true b=true
b=true c=false
D.a=false b=false
b=true c=false
相关试题
  • 需求分析阶段的任务是( )。
  • 已知一个有序线性表为(13,18,24,...
  • 以下各选项中能正确声明一个表示50个值为...
  • 在Java中,线程是( )。
  • 下列关于线程和进程的说法正确的是( )。