оГ
Size: a a a
оГ
оГ
VK
1 switch
{
0 => "0",
_ => "1"
};
SB
AH
VK
Д
оГ
AH
оГ
оГ
оГ
оГ
IC
AH
var x = switch (shape.getType()) {
case RECTANGLE -> {
var rect = (Rectangle) shape;
yield rect.getWidth() * rect.getHeight();
};
case CIRCLE -> {
var circle = (Circle) shape;
var radius = c.getDiameter() / 2;
yield Math.PI * radius * radius;
};
default -> throw new IllegalOperationException();
};
AH
оГ