Quiz · Interfaces, enums and records · lesson 8 of 8
Quiz — a record and equals
What does the program print?
public class Main {
public static void main(String[] args) {
P a = new P(1, 2);
P b = new P(1, 2);
System.out.println(a.equals(b) + " " + a);
}
}
record P(int x, int y) {}