JavaCompilerCore/resources/bytecode/javFiles/RecordTest.jav

22 lines
434 B
Plaintext
Raw Normal View History

2023-07-31 13:11:35 +00:00
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);
doesEqual() { return a.equals(b); }
doesNotEqual() { return b.equals(c); }
hashCode() { return a.hashCode(); }
toString() { return a.toString(); }
}