Create object using Class(Class Name)

object ThreadAndRunnable  {
  def main(args: Array[String]): Unit = {
    val strCat :String = "Cat"

    //....I have to create object for Cat but I have a String "Cat". 
  }
}

class Animal{
  def eat() = println("I Am Animal, I can Eat Anything")
}

class Cat extends Animal{
  override def eat(): Unit = println("I am Cat, I eat Fish")
}

I have to create an object for Cat, but I have a String "Cat". How to create an object using the String "Cat"?

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum