Assume that a BodyWeight class contains only one setWeight methoda two-parameter version with the parameters double weight

Question:

Assume that a BodyWeight class contains only one setWeight method—a two-parameter version with the parameters double weight and String units. Write two constructors for the BodyWeight class, one with one argument (double weight), and the other with two arguments (double weight and String units). For the one-argument constructor, use the default of “kg” for units. Avoid code redundancy. That is, have the one-parameter constructor call the two-parameter constructor, and have the two-parameter constructor call the two-parameter setWeight method.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: