单项选择题
下列有关Java语言的叙述中,正确的是
A.可以有2个以上package语句
B.可以有2个以上import语句
C.可以有2个以上public类
D.只能有1个类定义
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
下列程序的功能是在监控台上每隔一秒钟显示一个字符串 Hello! ,能够填写在程序中下划线位置,使程序完整并能正确运行的语句是 public class Test implements Runnable public static void main(String args[]) Test t=new Test(); Thread tt=new Thread(t); tt.start(); public void run() for(;;) try ______; catch(______e) System.out.println( Hello );
A.sleep(1000)
InterruptedException
B.sleep(1000)
InterruptedException
C.Thread.sleep(1000)
RuntimeException
D.Thread.sleep(1000)
InterruptedException
点击查看答案&解析
单项选择题
下面程序段的输出结果是 public class Test public static void main(String args[]) int x,y; x=(int)Math.sqrt(5) 2+(int)Math.random()*5 2; y=(int)Math.sqrt(3) 2+(iht)Math.random()*3 2; if(x>y) System.out.println( x>y ); else if (x==y) System.out.println( x=y ); else System.out.println( x<y );
A.x>y
B.x=y
C.x<y
D.编译错误
点击查看答案&解析
相关试题
Java对象串行化技术,主要是通过_____...
Swing的顶层容器有:JApplet,JWindow,JDi...
下面程序段是从对象流中读取对象,请将程序...
线程在生命周期中要经历5种状态,分别是新...
8|9&10^11的结果是______。