单项选择题

下列程序的运行结果是( )。
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
相关试题
  • 当使用Thread t=new Thread(r)创建一...
  • 请阅读下列程序代码,然后将程序的执行结果...
  • break语句最常见的用法是在switch语句中,...
  • FileInputStream是字节流,BufferedWriter...
  • 线程在生命周期中要经历5种状态,分别是新...