Question: 21. Consider a two-dimensional array of Clock values called allclocks. A code segment manipulating all clocks is as follows: for (Clock [] row: allClocks) for

![code segment manipulating all clocks is as follows: for (Clock [] row:](https://s3.amazonaws.com/si.experts.images/answers/2024/09/66de5a5d25218_15666de5a5c84b4d.jpg)

21. Consider a two-dimensional array of Clock values called allclocks. A code segment manipulating all clocks is as follows: for (Clock [] row: allClocks) for (Clock : row) /* more code */ Assuming the clock class works as specified, which replacement for /* more code error? will cause an 1. II. System.out.print(c); C.setTime(0, 0, 0); System.out.print(c.hours); III. a. I only b. II only c. III only d. II and III only e. I and II only 22. 1 public class SomeClass { private int num; public SomeClass(int n) { num = n; } public void setToZero () { num = 0; } public int getNum() { return num; } The following code segment appears in another class. SomeClass one = new SomeClass (7); SomeClass two = new SomeClass(8); SomeClass three = two; one.setToZero(); two.setToZero ; System.out.println(one.getNum () + " " + two.getNum() + " " + three.getNum()); What is printed as a result of executing the code segment? A. 7 8 8 B. O 8 8 C. O O 8 D. 0 0 0 E. 0 0 7 U. (1 punt) Assume that x and y are variables of type int. The expression: ! (x > y) 11 ! (x y) is equivalent to which of the following? A. true B. false C. x == y D. x != y E. (x = y)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
