Create a class called Animal
that has a constructor method that takes one argument: species
. It should have a getter for species and a method called makeSound()
that logs a sound the animal makes. Create a subclass called Cat
that extends the Animal class. Add a method to the Cat class called purr()
that logs purr
to the console. Create a subclass called Dog
that extends the Animal class. Add a method to the Dog class called bark()
that logs woof
to the console.
-
Notifications
You must be signed in to change notification settings - Fork 0
piyush8188/get-set-animals-piyush8188
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published