题目内容

以下程序的运行结果是?public class Conditional {public static void main(String[] args) {int x = 4;System.out.print("Value is " + ((x > 4) ? 99.99 : 9));}}

A. 输出:Value is 99.99
B. 输出:Value is 9
C. 输出:Value is 9.0
D. 第4行出现编译错误

查看答案
更多问题

下列程序执行的结果是?int x = 1,y = 1;if(x++==2 & ++y==2){x =7;}System.out.println("x="+x+",y="+y);

A. x=2,y=2
B. x=1,y=2
C. x=2,y=1
D. x=1,y=1

下列程序运行的结果是?int x = 1,y = 1;if(x++==1 | ++y==1){x =7;}System.out.println("x="+x+",y="+y);

A. x=7,y=2
B. x=2,y=7
C. x=7,y=7
D. x=2,y=2

下列程序执行的结果是?int x = 1,y = 1;if(x++==1 || ++y==1){x =7;}System.out.println("x="+x+",y="+y);

A. x=7,y=1
B. x=1,y=1
C. x=7,y=7
D. x=1,y=7

下列程序执行的结果是?boolean b = true;if(b==false)System.out.println("a");else if(b)System.out.println("b");else if(!b)System.out.println("c");elseSystem.out.println("d");

A. a
B. b
C. c
D. d

答案查题题库