-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
Description
var is not allowed/recognized in this swith case expression:
switch (shape) {
case Circle(var radius) -> {
double circleArea = Math.PI * radius * radius;
System.out.println("Area of Circle: " + circleArea);
}
case Rectangle(var width, var height) -> {
double rectangleArea = width * height;
System.out.println("Area of Rectangle: " + rectangleArea);
}
}