JavaCompilerCore/resources/bytecode/javFiles/RecordTest.jav

22 lines
462 B
Java

import java.lang.Integer;
record Rec(Integer a, Integer b) {}
/*public class Rec {
x; y;
Rec(Integer a, Integer b) {
x = a;
y = b;
}
}*/
public class RecordTest {
a = new Rec(10, 20);
b = new Rec(10, 20);
c = new Rec(20, 40);
public doesEqual() { return a.equals(b); }
public doesNotEqual() { return b.equals(c); }
public hashCode() { return a.hashCode(); }
public toString() { return a.toString(); }
}