Question: write in java language Quickly plz Invalid SalaryException Employee -name: String -Salary: double +Employee(String, double) +set Salary(double): void +Invalid SalaryException() +Invalid SalaryException(String) 1. Implement a

write in java language Quickly plz
Invalid SalaryException Employee -name: String -Salary: double +Employee(String, double) +set Salary(double): void +Invalid SalaryException() +Invalid SalaryException(String) 1. Implement a user defined exception class called Invalid SalaryException. The class Must have two constructors, a constructor that takes no parameters, and a constructor that takes a string message. These constructors should call the corresponding constructors from the class java.lang. Exception. 2. Implement the class Employee, as follows: public void set Salary(double sal This method throws Invalid Salary Exception if the value of salis an less than zero. Otherwise, it sets the salary attribute to sal. You should change the Method signature to include the corresponding throws expression. ii.) public Employee(String name, , double salary This constructor initializes the class attributes this.name and this.salary appropriately. Implement a Main Method in the class Employee, as follows: a. Add a try-catch-finally blocks. The try block must include the following statements: 1. Create and instantiate an object of type Employee. 2. Call the method set Salary() on the object, where the actual parameter is 400. b. The catch block should catch Invalid SalaryException, and should call ther Method printStackTrace(): C. The finally block should print the string: "end of program execution
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
