【单选题】【消耗次数:1】
以下程序的运行结果是:( ) 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
参考答案:
复制
纠错
相关题目
【单选题】 System.out.println(5 + 2);的输出结果应该是( )。
①  52
②  7
③  2
④  5
【单选题】 下列程序执行的结果是( ) 。 public class X7_1_6 { public static void main(String[] args) { try{ return; } finally{ System.out.println(Finally); } } }
①  程序正常运行,但不输出任何结果
②  程序正常运行,并输出 Finally
③  编译通过,但运行时出现异常
④  因为没有 catch 子句,因此不能通过编译
【单选题】 编译运行以下程序后,关于输出结果的说明正确的是 ( ) 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
③  编译错误
④  运行成功,但不输出
【单选题】 关于以下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
【单选题】 阅读以下代码: 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 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
【单选题】 关于以下程序代码的说明正确的是( ) 1.class HasStatic{ 2. private static int x=100; 3. public static void main(String args[ ]){ 4. HasStatic hs1=new HasStatic( ); 5. hs1.x++; 6. HasStatic hs2=new HasStatic( ); 7. hs2.x++; 8. hs1=new HasStatic( ); 9. hs1.x++; 10. HasStati@@x- -; 11. System.out.println(“x=”+x); 12. } 13. }
①  5行不能通过编译,因为引用了私有静态变量
②  10行不能通过编译,因为x是私有静态变量
③  程序通过编译,输出结果为:x=103
④  程序通过编译,输出结果为:x=102
【单选题】 运行下面程序时,会产生什么异常?( ) 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
【单选题】 以下程序的运行结果是( )。 Main() {int k=4,a=3,b=2,c=; printf(\n %d\n,ka?k:cb?c:a); }
①  4
②  3
③  2
④  1
随机题目
【单选题】 牡丹采摘花蕾应选在[ ]进行,以防伤口感染病害
①  阴天
②  雨天
③  晴天露水干后
④  多云
【单选题】 培养基各试剂应使用()纯
①  化学
②  分析
③  色谱
④  普通
【单选题】 对于长日照植物,北药南移时,会出现?
①  早熟
②  不开花结实
③  营养生长发育停止
④  不受影响
【单选题】 决定能否复种的关键条件是什么?
①  热量
②  水分
③  肥料
④  地力
【单选题】 有些种子如山楂、女贞,其休眠的原因是?
①  种皮障碍
②  发芽抑制物
③  胚未成熟
④  种皮过厚
【单选题】 主要是以无机盐形式的肥料,有效养分高,体积小,易溶于水,肥效快。但长期单独大量使用会造成土壤板结是哪种肥料的特征?
①  有机肥
②  微肥
③  化肥
④  菌肥
【单选题】 连作时生长严重受阻,植株矮小,发育异常,减产严重,甚至绝收。如烟草属于哪项?
①  耐连作作物
②  耐短期连作
③  不耐连做作物
④  忌连作作物
【单选题】 氮肥属于以下哪种肥料?
①  有机肥
②  微肥
③  化肥
④  菌肥
【单选题】 对玄参进行培土,目的是?
①  促进生根
②  保护芽头
③  避免根部外露
④  防止倒伏
【单选题】 人工利用植物的某一部分与母体分离进行繁殖的方法是哪种繁殖
①  压条繁殖
②  扦插繁殖
③  分株繁殖
④  嫁接繁殖