Suppose you have a Human class with a class property named avgAge. a) Why is it appropriate
Fantastic news! We've Found the answer you've been seeking!
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 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.
Posted Date: