【单选题】【消耗次数:1】
阅读以下代码: 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 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
④  编译错误
【单选题】 编译下面源程序会得到哪些文件( )? 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 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
【单选题】 下列程序执行的结果是( ) 。 public class X7_1_6 { public static void main(String[] args) { try{ return; } finally{ System.out.println(Finally); } } }
①  程序正常运行,但不输出任何结果
②  程序正常运行,并输出 Finally
③  编译通过,但运行时出现异常
④  因为没有 catch 子句,因此不能通过编译
【单选题】 应用程序的main方法中有以下语句,则输出的结果是 ( )。 String s1=new String(abc); String s2=new String(abc); boolean b1=s1.equals(s2); boolean b2=(s1==s2); System.out.print(b1+ +b2);
①  true false
②  false true
③  true true
④  false false
【单选题】 下列程序从标准输入设备读入一个字符, 然后再输出到显示器, 选择正确的一项填入“//x” 处,完成要求的功能( ) 。 import java.io.*; public class X8_1_4 { public static void main(String[] args) { char ch; try{ //x System.out.println(ch); } catch(IOException e) { e.printStackTrace(); } } }
①  ch = System.in.read();
②  ch = (char)System.in.read();
③  ch = (char)System.in.readln();
④  ch = (int)System.in.read();
【单选题】 下列程序段执行后的结果是( )。 String s = new String(abcdefg); for (int i=0; i<s.length(); i+=2){ System.out.print(s.charAt(i)); }
①  aceg
②  ACEG
③  abcdefg
④  abcd
【单选题】 System.out.println(5 + 2);的输出结果应该是( )。
①  52
②  7
③  2
④  5
【单选题】 下列程序的运行结果是( ) 。 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
③  编译错误
④  运行成功,但不输出
随机题目
【单选题】 评价中心应用中情境设计是十分重要的工作,一般考虑以下几个方面:①相似性,②?,③逼真性,④主题突出,⑤难度适当。
①  典型性
②  模拟性
③  可操作性
④  表出性
【单选题】 绩效考评主要是对主体?的分析与审定。具体地说,绩效考评是指考评主体对个体或组织活动成果及其价值的考查与评定。
①  工作前状态
②  工作中过程
③  工作后结果
④  过程中的表现
【单选题】 用先进的科学技术和手段,对各类人才所具备的知识水平、能力及其倾向、发展潜力、工作技能及绩效实施测量和评价的管理活动是?。
①  人员测评
②  绩效评估
③  素质测评
④  能力倾向测评
【单选题】 素质的第一特性是它的?。它是个体行为发展与事业成功的必要条件,但不是充分条件。它说明了素质开发的必要性。
①  可塑性
②  可靠性
③  差异性
④  原有基础作用性
【多选题】 下列属于操作与运用考核性测评原则的有?。
①  全面性原则
②  充足性原则
③  可信性原则
④  针对性原则
⑤  权威性原则
【多选题】 权重是指测评指标在测评体系中的重要性或测评指标在总分中应占的比重,其数量表示即为权数。加权的类型有以下几种基本形式?。
①  简单加权
②  综合加权
③  纵向加权
④  横向加权
⑤  回归加权
【多选题】 人员素质测评量化就是通过测量手段来揭示素质的?特征,使人们对素质有更深入、更本质的认识。
①  数量
②  质量
③  心理
④  个性
⑤  多维
【多选题】 面试的基本类型有?。
①  操作综合式
②  压力面试
③  结构面试与半结构面试
④  小组讨论
⑤  公文处理
【多选题】 下列有关对素质测评表述不正确的是?。
①  素质测评必须以某一行为事实为依据
②  素质测评是对主体工作前条件的分析与确定
③  素质测评实质上就是素质测量
④  素质测评与绩效考评是等同的
⑤  素质测评可以为人事配置提供科学依据
【多选题】 从记忆层次测评知识,有以下几种基本方式:?法。
①  理解
②  综合
③  回忆
④  再认
⑤  思维