mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-06 10:07:41 +07:00
when patterns in switch are available GitOrigin-RevId: 1a3458be17a41b492fbae86e186c8792c46a2b12
9 lines
273 B
Java
9 lines
273 B
Java
class X {
|
|
public static double getPerimeter(Shape shape) throws IllegalArgumentException {
|
|
switch (shape) {<caret>
|
|
}
|
|
}
|
|
}
|
|
interface Shape { }
|
|
record Rectangle(double length, double width) implements Shape { }
|
|
record Circle(double radius) implements Shape { } |