Consider the following block of Java code. How many times will it output "Hello"?
1 2 3 4 |
|
Select one:
- a. 0
- b. 9
- c. 1
- d. 10
- e. Way too many!
Notice the update, "i--". "i" starts less than 10 and just keeps getting smaller. (The loop is technically not infinite. "i" will eventually reach the most-nega tive value that "int" can represent, and then it wil l wrap around to the largest possible "int", ending the loop.) The correct answers are: 1, Way too many!