Question: string color string name integer age and define the following public methods: getColorO has no parameters and returns the color field. getName ( ) has
string color
string name
integer age
and define the following public methods:
getColorO has no parameters and returns the color field.
getName has no parameters and returns the name field.
getAge has no parameters and returns the age field.
Ex If the input is brown Avi then the output is:
Color: brown
Name: Avi
Age:
Note: If a field is not properly declared as private, an error message will be output.
public class Deer
your code goes here
public void setcolor String newcolor
color newColor;
public void setNamestring newName
name newName;
public void setageint newage i
age newAge;
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
