What is the output of the following code snippet int

Info icon This is a preview. Sign up to view the full content.

View Full Document Right Arrow Icon
9) What is the output of the following code snippet? int i = 1; while (i < 20) { System.out.print(i + " "); i = i + 2; if (i == 15) { i = 19; } } a- 1 3 5 7 9 11 13 15 17 19 b- 1 3 5 7 9 11 13 19 c- 1 3 5 7 9 11 13 15 17 d- 1 3 5 7 9 11 13 17 19 10) A UML class diagram would be most useful in visually illustrating which of the following? a- the cohesiveness of a class’s interface b- the amount of complexity of a class’s interface. c- relationships between classes and their interfaces . d- dependencies between classes. 11) It may be necessary to "grow" an array when reading inputs because a- the number of inputs may not be known in advance. b- arrays in Java must be resized after every 100 elements. c- arrays are based on powers of two. d- the only alternative is a bounds exception. 12) Which loop does not check a condition at the beginning of the loop? i. The do loop ii. The while loop iii. The for loop
Image of page 3