题目内容

下列语句片段的结果为int result;int a=17,b=6;result=(a%b>4)? a%b:a/b ;System.out.println(result);

A. 0
B. 1
C. 2
D. 5

查看答案
更多问题

以下代码的输出结果?public class Test{int x=5;public static void main(String argv[]){Test t=new Test();t.x++;change(t);System.out.println(t.x);}static void change(Test m){m.x+=2;}}

A. 7
B. 6
C. 5
D. 8

以下程序的运行结果为
class Prob10 {
static boolean b1;
public static void main(String [] args) {
int i1 = 11;
double f1=1.3;
do {
b1 = (f1 >4、&& (i1--< 10);
f1 += 1.0;
} while (!b 1、;
System.out.println(b1 + "," + i1 + "," + f 1、;
}
}

A. false,9,4.3
B. true,11,1.3
C. false,8,1.3
D. true,8,7.3

以下程序的运行结果为:1. public class Conditional {2. public static void main(String args [] ) {3. int x = 4;4. System.out.println("value is " +((x >4、? 99.99 : 9));5. }6. }

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

以下代码中变量result的可能类型有哪些?byte b = 11;short s = 13;result = b * ++s;

A. byte, short, int, long, float, double
B. boolean, byte, short, char, int, long, float, double
C. byte, short, char, int, long, float, double
D. byte, short, char
E. int, long, float, double

答案查题题库