JavaCompilerCore/resources/bytecode/javFiles/OverloadPattern.jav

19 lines
316 B
Plaintext
Raw Normal View History

import java.lang.Integer;
2023-10-17 10:26:40 +00:00
import java.lang.Float;
import java.lang.Number;
2023-10-17 10:26:40 +00:00
record Point(Number x, Number y) {}
public class OverloadPattern {
m(Point(Integer x, Integer y)) {
return x + y;
}
2023-10-17 10:26:40 +00:00
m(Point(Float x, Float y)) {
return x * y;
}
m(Integer x) {
return x;
}
}