Create a class called Employee that should include four pieces of information as instance variablesa firstName (type String), a lastName (type String), a mobileNumber (type String) and a salary (type int).
1) Your class (Employee) should have a full argumentconstructor that initializes the four instance variables.
2) Provide a set and a get method for each instance variable. The validation for each attribute should be like below:
a. mobileNumber should be started from 05 and the length will be limited to 10 digits.
b. salary should be greater than zero.
3) In addition, provide a method named getYearlySalary()that calculates the yearly salary (i.e., multiplies the salaryby 12), then returns the amount as a double value.
4) The toString() print the following information
Employee Name: FirstName LastName
Mobile No. 0512345678
Employee Salary: 2000
5) Override the equals() method to return the true if the current Employee object has the same firstName and lastNamefields as the Employee object referenced by the input argument and false otherwise.
Derived Class Information
1) Create another class called SalesEmployee which inherits all the properties of Employee Class. The SalesEmployeeshould include specific attributes- a sales (type int) and a commissionRate (type double).
2) SalesEmployee Class should have a full argumentconstructor that initializes the SIX instance variables(Base Class (4) and Derived Class (2)). Call constructor of base class, i.e., Employee class from derived class (SalesEmployee) constructor as below:
a. Super (fname, lname, mobile, salary)
3) Provide a set and a get method for each specific attribute of SalesEmployee class.
4) Override the getYearlySalary() method in SalesEmployee class to calculate the salary as below:
return ((super.salary + (sales * commissionRate)) * 12);
6) The toString() print the following information
Employee Name: FirstName LastName
Mobile No. 0512345678
Sales Employee Salary: 22000
3. Override the equals() method to return the true if the current SalesEmployee object has the firstName, lastName, and salesfields as the SalesEmployee object referenced by the input argument and false otherwise.
Important Note 3: Make sure to call the equals() method of the SalesEmployee class.
InheritanceTest Class Information
1) Write a test app named InheritanceTest that demonstrates class Employee and SalesEmployee classes capabilities.
2) Create an object (i.e., empObj) of Employee class and print all the information in the defined toString() method format.
3) Create an object (i.e., SalesEmpObj) of SalaesEmployeeclass and print all the information in the defined toString()method format.