题目内容

现有:class WhileTests {public static void main(String[] args) {int x = 5;while (++x < 4) {--x;}System.out.println("x=" + x);}}结果是什么?

A. x=6
B. x=5
C. x=2
D. 编译失败

查看答案
更多问题

现有:class Foo {public static void main(String[] args) {int x = 0;int y = 4;for (int z = 0; z < 3; z++, x++) {if (x > 1 & ++y < 10)y++;}System.out.println(y);}}结果是什么?

A. 7
B. 8
C. 10
D. 12

int i=1 , j=10;do{if(i>j)continue;j--;}while(++i<6);经过上面的代码后,i和j的值是多少?( )

A. i=6,j=5
B. i=5,j=5
C. i=6,j=4
D. i=5,j=6

What will be the value of x after the following code is executed?执行以下代码后,x的值是多少?int x = 10, y = 20;while (y < 100){x += y;}

A. 90
B. 110
C. 210
D. This is an infinite loop 这是一个死循环/无限循环

____________is the process of inspecting data given to the program by the user and determining if it is valid.哪一个是检查用户提供给程序的数据并确定其是否有效的过程。

A. Data parsing 数据分析
B. Input validation 输入验证
C. User authentication 用户身份验证
Defensive coding 防御性编码

答案查题题库