Create an abstract class Shape with an abstract property area. Add a subclass Square and override the area property with the length of the side of the square.
Overriding properties
Square class and properties
Report a typo
Sample Input 1:
4Sample Output 1:
16Sample Input 2:
5Sample Output 2:
25Write a program in Kotlin
abstract class Shape {
// make your code here
}
class Square(val side: Double) : Shape() {
// make your code here
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.