Logo
2

After you run the code, new_cat = Cheshire("Cat1"), how many instance variables exist for the new_cat instance of Cheshire?

A. 1 B. 2 C. 3 D. 4

rajanarajana asked 2 years ago

·

Answers

1

Answer is D. 4

Neither Cheshire nor Cat defines an init constructor method, so the grandaprent class, Pet, will have it's init method called. That constructor method sets the instance variables name, hunger, boredom, and sounds.

davidmacagodavidmacago answered 2 years ago

Post your answer

Recommended Books

Reading books is a great way to learn. Here are some of the books we recommend.