_____ 4. Consider the following code segment. int x = 7; int y = 3; if((x < 10) && (y < 0)) { System.out.println(“Value is: “ + x * y); } else { System.out.println(“Value is: “ + x / y); } What is printed as a result of executing the code segment?
_____ 5. Consider the following method. public ArrayList<Integer> mystery(int n) { ArrayList<Integer> seq = new ArrayList<Integer>(); for(int k = 1; k <= n; k++) { seq.add(new Integer(k * k + 3)); } return seq; } What is printed as a result of executing the following statement? System.out.println(mystery(6));
(A)[3, 4, 7, 12, 19, 28] (B)[3, 4, 7, 12, 19, 28, 39] (C)[4, 7, 12, 19, 28, 39] (D)[39, 28, 19, 12, 7, 4] (E)[39, 28, 19, 12, 7, 4, 3]
