单选题Java中用于提供Java语言、Java虚拟机的核心的类和接口的包是( )。 A.java.io包 B.java.applet包 C.java.lang包 D.iava.net包
单选题设a=8,则表达式少>>>1的值是
单选题下面关于继承的叙述正确的是 ( )
单选题子类可以继承父类的哪个成员?A)非私有B)私有C)public D)protected
单选题查找随机文件的记录时,所应使用的方法是______。 A) readlnt() B) readBytes(int n) C) seek(long l) D) readDouble()
单选题下列关于内部类的说法中不正确的是______。
单选题在程序的下画线处应填入的选项是( )。 public class Test______ public static void main(String args[]) Test t=new Test(); Thread tt=new Thread(t); tt.start(); public void run() for(int i=0;i<5;i++) System.out.println("i="+i);
单选题下面程序段的输出结果是( )。 publicclassTest publicstaticvoidmain(Stringargs[]) intx,y; x=(int)Math.sqrt(5)/2+(int)Math.random()*5/2; Y=(int)Math.sqrt(3)/2+(int)Math.random()*3/2; if(x>y) System.out.println9"x>y"); elseif(x==y) System.out.println("x=y"); else System.out.println("x<y"); A.x>y B.x=y C.x<y D.编译错误
单选题下列关于Java语言特点的叙述中,错误的是( )。
单选题有以下程序: main() char k;int i; for(i=1;i<3;i++) scanf("%c",&k); switch(k) case'0': printf("another/n"); case'1': printf("number/n"); 程序运行时,从键盘输入:01<回车>,程序执行后输出的结果是( )。 A.another number another B.another number number C.another number D.number number
单选题下列代码的执行结果是( )。 public class Test public static void main (String args[]) int a=3,b=5,c=8; String s="abc"; System.out.println(a+b+s+c);
单选题下列代码的执行结果是
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");
}
}
}
}
单选题Java语言中提供处理不同类型流的类包是( )。
单选题在oneMethod()方法运行正常的情况下,程序段将输出什么? ( ) public void test() try oneMethod(); System.out.println("condition 1"); catch(ArrayIndexOutOfBoundsException e) System.out.println("condition 2"); catch(Exception e) System.out.println("condition 3"); finally System.out.println("finally");
单选题下列方法中( )是执行线程的方法。
单选题Java程序的执行过程中用到一套JDK工具,其中javadoc.ext是指( )。
单选题下列方法中,不属于WindowListener接口的是______。
单选题有以下程序:
void main()
{ char str[][10]={"China","Beijing"},*p=str[0];
printf("%s/n",p+10);
}
程序运行后输出的结果是
____
。
单选题设i,j为类X定义的double型变量名,下列X类的构造方法中不正确的是
单选题下面程序段的输出结果是______。 class Test public static void main(String args[ ]) MyThread t=new MyThread( ); t.displayOutput("t has been created"); t.start( ); class MyThread extends Thread public void display Output(String s) System.out,println(s); public void run( ) displayOutput("t is running");