JavaCompilerCore/resources/bytecode/javFiles/RecordTest.jav

22 lines
474 B
Plaintext
Raw Permalink 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 {
2024-03-25 12:51:56 +00:00
Rec a = new Rec(10, 20);
Rec b = new Rec(10, 20);
Rec c = new Rec(20, 40);
2023-07-31 13:11:35 +00:00
2024-03-14 12:50:56 +00:00
public doesEqual() { return a.equals(b); }
public doesNotEqual() { return b.equals(c); }
public hashCode() { return a.hashCode(); }
public toString() { return a.toString(); }
2023-07-31 13:11:35 +00:00
}