题目内容

下列程序 test 类中的变量 c 的最后结果为() 。public class test{public static void main(String args[]){int a=10;int b;int c;if(a>50) {b=9;}c=b+a;}}

A. 10
B. 0
C. 19
D. 编译出错

查看答案
更多问题

变量x、y和z的定义:int x=10,y=20,z=30; 则表达式 x> y ? (x> z ? x : y) : (y> z ? y : z) 的值是()。

A. 10
B. 20
C. 30
D. 表达式错误

下面程序运行输出的结果是()public class Test1 {public static void main(String[] args) {int x=4 ;System.out.println("value is "+(x>4?99.9:9));}}

A. value is 99.9
B. value is 9
C. value is 9.0
D. 99

下列程序标注的【代码1】,【代码2】的输出结果是什么?(答案格式:【代码1】:_____。【代码2】:_____。)public class E {public static void main(String args[]) {int [] a={10,20,30,40},b[]={{1,2},{4,5,6,7}};b[0] = a;b[0][1] = b[1][3];System.out.println(b[0][3]); //【代码1】System.out.println(a[1]); //【代码2】}}

下列程序标注的【代码1】,【代码2】的输出结果是什么?(答案格式:【代码1】:_____。【代码2】:_____。)public class E {public static void main (String args[ ]){long[] a = {1,2,3,4};long[] b = {100,200,300,400,500};b = a;System.out.println("数组b的长度:"+b.length); //【代码1】System.out.println("b[0]="+b[0]); //【代码2】}}

答案查题题库