下列程序的运行结果? public class Test { public static void main(String a[]) { int x=3,y=4,z=5; if (x>3) { if (y<2) System.out.println("show one"); else System.out.println("show two"); } else { if (z>4) System.out.println("show three"); else System.out.println("show four"); } } }
举一反三
- 下列程序的运行结果是______。 public class Test { public static void main (String[] args) { int x=3, y=4, z=5; if (x>3) { if (y<2) System.out.print ("show one"); else System.out.print ("show two"); } else{ if (z>4) System.out.print ("show three"); else System.out.print ("show four"); } } } A: show one B: show two C: show three D: show four
- 以下程序段的输出结果为 【14】 。int x=0,y=4,z=5;if(x>2)if(y<5)System. out. println("Message one");elseSystem. out . println("Message two");else if(z>5)System. out. println("Message three");elseSystem. out. println("Message four");
- 以下代码段的输出结果为1. int x = 0, y = 4, z = 5;2. if (x > 2) {3. if (y < 5) {4. System. out .println ( "message one" );5. }6. else {7. System.out.println( "message two");8. }9. }10. else if (z > 5) {11. System.out.println("message three");12. }13. else {14. System.out.println( "message four");15. } A: message one B: message two C: message three D: message four
- 中国大学MOOC: 下列代码中构造方法的返回类型是()public class Village { Village () { System .out .println(“hiding in Village”) ; } public static void main( String args [ ]) { Village c =new Village ( ) ;}class Village { public static void main( String args [ ]) { Village c =new Village ( ) ; } Village () { System .out .println(“hiding in Village”) ; } }
- 请阅读下面的程序 public class Example03 { public static void main(String args) { int x = 3; if (x > 5) { System.out.println("a"); } else { System.out.println("b"); } } } 程序的运行结果是()