题目内容

以下程序的输出结果为:public class example {public static void main(String args[]) {int i=0;for (i=0;i<4;i++) {if (i==3、break;System.out.print(i);}System.out.println(i);}}以下程序的输出结果为:public class example {public static void main(String args[]) {int i=0;for (i=0;i<4;i++) {if (i==3、break;System.out.print(i);}System.out.println(i);}}

A. 0123 B.0122 C.123 D.234

查看答案
更多问题

下列语句片段的结果为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行出现编译错误

答案查题题库