Question: Suppose you have a Human class with a class property named avgAge. a) Why is it appropriate to have avgAge be a class property instead
Suppose you have a Human class with a class property named avgAge.
a) Why is it appropriate to have avgAge be a class property instead of a regular property?
b) Assume that the avgAge property gets assigned a value only after a Human object gets instantiated.
Provide an if statement for the Human constructor that takes care of the avgAge property for the first instantiated Human object. Specifically, check for avgAge not having a value and if that's the case, assign the age parameter's value to the avgAge property.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
