KOTLIN: Classes and Inheritance
Given the Pet as the parent class of the Cat, Dog, and Fish. Complete the code so that each instance of Cat, Dog and Fish can shows their informations and action as given.open class val petName = name val petColor = color displayAction(){} fun displayInfo(action: String) { println("A pet named $petName with color $petColor do $action" } } class Cat ) : Pet(name, color) { override fun displayAction () { displayInfo("meow") } } fun main() { Cat ("Garfield", "Orange").displayAction () Dog("Pluto", "Black").displayAction () Fish ("Jenny", "Gold").displayAction () }