Create a class named Animal with the open makeSound() method that displays the message "The animal makes a sound". Then create a subclass Dog that overrides this method by displaying the message "The dog barks".
Computer scienceProgramming languagesKotlinObject-oriented programmingObject-oriented programming basic
Final members
Animal sounds
Report a typo
Sample Input 1:
Sample Output 1:
The dog barks
The animal makes a soundWrite a program in Kotlin
// make your class Animal here
// make your class Dog 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.