Get startedGet started for free

Who's the Daddy?

a_microwave_oven is an object created by microwave_oven_factory. a_fancy_microwave is an object created by fancy_microwave_oven_factory. You can explore these objects in your workspace.

Which of the following statements are true?

  1. A microwave oven is a fancy microwave oven. That is, inherits(a_microwave_oven, "FancyMicrowaveOven") returns TRUE.
  2. A fancy oven microwave is a microwave oven. That is, inherits(a_fancy_microwave, "MicrowaveOven") returns TRUE.
  3. Both types of microwave oven are R6 objects. That is, inherits(a_microwave_oven, "R6") and inherits(a_fancy_microwave, "R6") both return TRUE.
  4. Only regular microwave ovens are R6 objects. That is, inherits(a_microwave_oven, "R6") returns TRUE but inherits(a_fancy_microwave, "R6") returns FALSE.
  5. Neither types of microwave oven are R6 objects. That is, inherits(a_microwave_oven, "R6") and inherits(a_fancy_microwave, "R6") both return FALSE.

This exercise is part of the course

Object-Oriented Programming with S3 and R6 in R

View Course

Hands-on interactive exercise

Turn theory into action with one of our interactive exercises

Start Exercise