1Z0-829 • Practice Test 35
Free 1Z0-829 practice test — 15 questions with explanations. Set 35. No signup required.
Refer to the exhibit. What is the output?
public record Point(int x, int y) {
public Point {
if (x < 0 || y < 0) {
throw new IllegalArgumentException();
}
}
public int x() { return x; }
public int y() { return y; }
}
public class Test {
public static void main(String[] args) {
Point p1 = new Point(1, 2);
Point p2 = new Point(1, 2);
System.out.println(p1.equals(p2));
System.out.println(p1.x() == p2.x());
}
}