【单选题】【消耗次数:1】
编译下面源程序会得到哪些文件( )? class A1{ } class A2{ } public class B{ public static void main(String[] args) { } }
只有B.class 文件
只有 A1.class 和 A2.class 文件
编译不成功
A1.class、A2.class 和B.class 文件
参考答案:
复制
纠错
相关题目
【单选题】 下面代码运行后的输出结果为( ) 。 public class X6_1_5 { public static void main(String[] args) { AB aa = new AB(); AB bb; bb = aa; System.out.println(b@@equals(aa)); } } class AB{ int x = 100; }
①  true
②  false
③  编译错误
④  100
【单选题】 下列程序执行的结果是( ) 。 public class X7_1_6 { public static void main(String[] args) { try{ return; } finally{ System.out.println(Finally); } } }
①  程序正常运行,但不输出任何结果
②  程序正常运行,并输出 Finally
③  编译通过,但运行时出现异常
④  因为没有 catch 子句,因此不能通过编译
【单选题】 运行下面程序时,会产生什么异常?( ) public class X7_1_4 { public static void main(String[] args) { int x = 0; int y = 5/x; int[] z = { 1,2,3,4 } ; int p = z[4]; } }
①  ArithmeticException
②  NumberFormatException
③  ArrayIndexOutOfBoundsException
④  IOException
【单选题】 运行下面程序时,会产生什么异常?( ) public class X7_1_5 { public static void main(String[] args) { int[] z = { 1,2,3,4 } ; int p = z[4]; int x = 0; int y = 5/x; } }
①  ArithmeticException
②  NumberFormatException
③  ArrayIndexOutOfBoundsException
④  IOException
【单选题】 编译运行以下程序后,关于输出结果的说明正确的是 ( ) public class Conditional{ public static void main(String args[ ]){ int x=4; System.out.println(“value is “+ ((x>4) ? 9.9:9)); } }
①  输出结果为:value is 99.9
②  输出结果为:value is 9
③  输出结果为:value is 9.0
④  编译错误
【单选题】 下列程序的运行结果是( ) 。 public class X5_1_2 extends x{ int ab() { static int aa=10; aa++; System.out.println(aa); } public static void main(String[] args) { X5_1_2 x=new X5_1_2(); x.ab(); } }
①  10
②  11
③  编译错误
④  运行成功,但不输出
【单选题】 以下程序的运行结果是:( ) public class Increment{ public static void main(String args[]){ int c; c = 2; System.out.println(@@; System.out.println(c++); System.out.println(@@; } }
①  2 2 2
②  2 3 3
③  2 2 3
④  3 4 4
【单选题】 阅读以下代码: import java.io.*; import java.util.*; public class foo{ public static void main (String[] args){ String s; System.out.println(s= + s); } } 输出结果应该是:( )
①  代码得到编译,并输出“s=”
②  代码得到编译,并输出“s=null”
③  由于String s没有初始化,代码不能编译通过
④  代码得到编译,但捕获到 NullPointException异常
【单选题】 已知有下面类的说明: public class X5_1_1 extends x{ private float f =10.6f; int i=16; static int si=10; public static void main(String[] args) { X5_1_1 x=new } } X5_1_1(); 在 main()方法中,下面哪条语句的用法是正确的?( )
①  x.f
②  this.si
③  X5_1_1.i
④  X5_1_1.f
【单选题】 给出下面代码段, 哪行将引起一个编译时错误?( ) 1) public class Test { 2) int n = 0; 3) int m = 0; 4) public Test(int a) { m=a; } 5) public static void main(String arg[]) { 6) Test t1,t2; 7) int j,k; 8) j=3; k=5; 9) t1=new Test(); 10) t2=new Test(k); 11) } 12) }
①  行1
②  行4
③  行6
④  行9
随机题目
【单选题】 估计标准误说明回归直线的代表性,因此
①  估计标准误数值越大,说明回归直线的代表性越大
②  估计标准误数值越大,说明回归直线的代表性越小
③  估计标准误数值越小,说明回归直线的代表性越小
④  估计标准误数值越小,说明回归直线的实用价值小
【判断题】 同一个总体,时期指标值的大小与时期长短成正比,时点指标值的大小与时点间隔成反比。
①  正确
②  错误
【判断题】 在对现象进行分析的基础上,有意识地选择若干具有代表性的单位进行调查,这种调查属于重点调查。
①  正确
②  错误
【判断题】 平均发展速度是环比发展速度的平均数,也是一种序时平均数。
①  正确
②  错误
【单选题】 填报单位是
①  调查标志的承担者
②  负责向上级报告调查内容的单位
③  构成调查对象的每一单位
④  重点单位
【判断题】 从全部总体单位中抽取部分单位构成样本,在样本变量相同的情况下,重复抽样构成的样本个数大于不重复抽样构成的样本个数。
①  正确
②  错误
【判断题】 平均指标因素分析建立的指数体系由三个指数构成,即可变构成指数、固定构成指数和结构变动影响指数。
①  正确
②  错误
【判断题】 按数量标志分组的目的,就是要区分各组在数量上的差异。
①  正确
②  错误
【单选题】 重点调查中重点单位是指
①  标志总量在总体中占有很大比重的单位
②  具有重要意义或代表性的单位
③  那些具有反映事物属性差异的品质标志的单位
④  能用以推算总体标志总量的单位
【单选题】 下列分组中属于按品质标志分组的是
①  学生按考试分数分组
②  产品按品种分组
③  企业按计划完成程度分组
④  家庭按年收入分组