Kitty naming

Report a typo

Supplement the abstract class so that classes inheriting from it don't have to override the method.

The following code must work:

class Cat(name: String, breed: String) extends Pet(name, breed):
  def getKittysName: String = "Cat's name is " + super.getFullName

val cat = Cat("Tom", "British Shorthair")
cat.getKittysName // Cat's name is Tom it's breed is British Shorthair

Sample Input 1:

Tom
British Shorthair

Sample Output 1:

Cat's name is Tom it's breed is British Shorthair
Write a program in Scala 3
abstract class Pet(val name: String, breed: String):
???
___

Create a free account to access the full topic