【单选题】【消耗次数:1】
编译运行以下程序后,关于输出结果的说明正确的是 ( ) 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
编译错误
参考答案:
复制
纠错
➡️如需代学继续教育,联系微信:yizhituziang

相关题目
【单选题】 以下程序的运行结果是:( ) 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 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 子句,因此不能通过编译
【单选题】 阅读以下代码: 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_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
③  编译错误
④  运行成功,但不输出
【单选题】 关于以下application的说明,正确的是( ) 1. class StaticStuff 2. { 3. static int x=10; 4. static { x+=5;} 5. public static void main(String args[ ]) 6. { 7. System.out.println(“x=” + x); 8. } 9. static { x/=3;} 10. }
①  4行与9行不能通过编译,因为缺少方法名和返回类型
②  9行不能通过编译,因为只能有一个静态初始化器
③  编译通过,执行结果为:x=5
④  编译通过,执行结果为:x=3
【单选题】 System.out.println(5 + 2);的输出结果应该是( )。
①  52
②  7
③  2
④  5
【单选题】 运行下面程序时,会产生什么异常?( ) 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
【单选题】 编译下面源程序会得到哪些文件( )? 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 文件
【单选题】 下列程序从标准输入设备读入一个字符, 然后再输出到显示器, 选择正确的一项填入“//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();
随机题目
【单选题】 市场调查报告的主要部分是:
①  序言
②  正文
③  附件
④  扉页
【多选题】 企业选择外部市场调查机构时,应考虑的因素有:
①  调查机构的经验
②  调查收费情况
③  调查机构的信誉
④  调查机构的设备条件
⑤  调查机构的业务能力
【多选题】 调查人员的培训内容通常包括:
①  相关规章制度的教育
②  性格修养方面的培养
③  调查业务方面的训练
④  心理学知识的学习
⑤  思想道德方面的教育
【多选题】 调查报告应坚持的原则是:
①  真实性
②  简明扼要
③  具体化
④  经济性
⑤  紧扣主题
【单选题】 市场调查报告应坚持的基本原则是:
①  真实性
②  具体化
③  简明扼要
④  紧扣主题
【判断题】 由于访问员直接与被调查者接触,故对他们要进行更为严格的全面训练。
① 
② 
【判断题】 大型企业内部通常都有市场调查部门,因此不需要借助外部调查机构。
① 
② 
【多选题】 市场调查的策划过程包括:
①  确定市场调查方法
②  明确市场调查主题
③  确定市场调查项目
④  确定市场调查进度
⑤  撰写调查项目建议书
【多选题】 市场调查报告的格式包括:
①  附件
②  序言
③  扉页
④  填写说明
⑤  正文
【多选题】 调查人员的培训方法主要有:
①  对话练习
②  模拟训练
③  举办培训班
④  技术培训
⑤  哈雷斯培训法