Creating cats

  • 4
  • Locked
Create valid cats in an unnatural way: using constructors. Let's create a Cat class and declare five different constructors. The simplest constructor contains one parameter: name. The next has name and age. And we'll add weight to the third. Read about the rest in the task conditions.
You can't complete this task, because you're not signed in.
Comments (4)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Anonymous #11074513
Level 10 , Taiwan, Province of China
12 September 2022, 06:35
滿奇怪的,我的作法跟答案是一樣的,但是就是沒辦法通過
Brandon Leirer
Level 7 , Keller, United States
4 June 2020, 20:48
I still don't understand why constructors that only need name, for instance, still need me to make up values for the other variables, but for some reason it is ok for me not to add in anything for address.
Nickolas Johnson
Level 8 , St. Louis, United States of America
9 March 2020, 14:56
This one is weird because for some of the constructors it forced me to manually put in a value. For others, it was OK if i used values initialized before any of the constructors. The second constructor was OK with grabbing an already initialized value but none of the rest were.
Geoff Green
Level 10 , Calgary, Canada
31 January 2020, 04:36
This is broken in intellij, I had to comment out //import javafx.css.converter.LadderConverter then it worked fine.