Question: Answer 10-14 Model II. (15 min) Printing a Java Class start time: Add the toString method to the Salary class (inside the last curly brace):
Model II. (15 min) Printing a Java Class start time: Add the toString method to the Salary class (inside the last curly brace): * Represents the salary for a person public class Salary ( private double annual; public void setAnnualsalary (double salary)t annual-salary public double getAnnualSalary) ( return annual; public String toString() ( return "s" + annual; Check that your Salary file still compiles. Critical Thinking Questions 10. What is the data type of the toString method's return value? the toString method. What value is printed? (Create the Salary object again in SalaryDemo class, and then print the return value from the toString method.) 11. Review your answer to Question 5, and give the line of code that prints the return value from
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
