Question: In the Moose class, declare the following private fields:integer agestring colorand define the following public methods:getAge ( ) has no parameters and returns the age
In the Moose class, declare the following private fields:integer agestring colorand define the following public methods:getAge has no parameters and returns the age field.getColor has no parameters and returns the color field.Ex: If the input is brown, then the output is:Age: Color: brownNote: If a field is not properly declared as private, an error message will be output.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
