Question: JAVA QUESTION 16 Write and submit the java source for the following class specification: The name of the class is Question_16 Class Question_16 has 3

JAVA

QUESTION 16 Write and submit the java source for the following class specification: The name of the class is Question_16 Class Question_16 has 3 instance variables: name of type String, age of type int and height of type double. Class Question_16 has the following methods:

print - outputs the data values stored in the instance variables with the appropriate label

setName - method to set the name

setAge - method to set the age

setHeight - method to set the height

getName - value-returning method to return the name

getAge - value-returning method to return the age

getHeight - value-returning method to return the height

toString - crates a String with labels and the data values stored in the instance variables.

default constructor - initializes name to the empty string, initializes age and height to 0.

constructor with parameters - sets the values of the instance variables name, age and height to the values provided by the parameters.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!