lzx17
发贴: 2
积分: 0
|
于 2006-05-28 11:24
What will be the result of executing the following code?
1. boolean a = true;
2. boolean b = false;
3. boolean c = true;
4. if (a == true)
5. if (b == true)
6. if (c == true) System.out.println("Some things are true in this world");
7. else System.out.println("Nothing is true in this world!");
8. else if (a && (b = c)) System.out.println("It's too confusing to tell what is true and what is false");
9. else System.out.println("Hey this won't compile");
Choices:
a. The code won't compile
b. "Some things are true in this world" will be printed
c. "Hey this won't compile" will be printed
d. None of these
应该选 c吧,答案是d
|