package snippets; public sealed interface Shape { default double area() { var area = switch (this) { case Square(var side) -> side * side; case Rectangle(var weight, var height) -> weight * height; case Circle(var radious) -> Math.PI * Math.pow(radious, 2); }; return area; } record Square(int side) implements Shape {} record Rectangle(int weight, int height) implements Shape {} record Circle(int radious) implements Shape {} }