1.The name of the class is Question_16. 2.Class Question_16 has 3 instance varia
ID: 3765768 • Letter: 1
Question
1.The name of the class is Question_16.
2.Class Question_16 has 3 instance variables: name of type String, age of type int and height of type double.. 3.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..
Explanation / Answer
import java.util. *; public class Question_16 { static Scanner console = new Scanner (System.in); int age; double height; String name; public Question_16 (String n, int a, double h) { name = n; age = a; height = h; } }
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.