Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fun area(shape: Shape): Double = when (shape) {
- is Rectangle -> shape.x * shape.y
- is Circle -> PI * shape.radius * shape.radius
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement