Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please explain everyline of this code. Thankyou! Source Code Output D'employee.java X Salary.java Emp.java Employees 12 src# (default package) of employee displayO:void 2 l/class 3

Please explain everyline of this code. Thankyou! Source Code image text in transcribed

image text in transcribedimage text in transcribed

Output

image text in transcribed

D'employee.java X Salary.java Emp.java Employees 12 src# (default package) of employee displayO:void 2 l/class 3 class employee { 4 5 //instance variable 6 int salary_deduc, salary, workingHour; 7 String name, time_in, time_out; 8 9 //default constructor 100 employee(){ 11 12 //argument constructor 13} 140 employee (String name, int workingHour) { this.name=name; 16 this.workingHour-workingHour; 17 18 19 20 //method 210 public void display(){ 22 System.out.println(" Employee Name = "+name+" Total Working Hour = "+workingHour); 23 24 25 d'employee.java Salary.java X Emp.java Employees 12 i src (default package) Salary 2 //Inheritance 3 class Salary extends employee 5 //Getter and setters for getting and setting properties 7 public int getSalaryDeduc() { return salary_deduc; 9} 100 public void setsalaryDeduc (int salary_deduc) { 11 this.salary_deduc = salary_deduc; 13 public int getsalary() { 14 return salary: 16 public void setsalary(int salary) { 17 this.salary = salary: 18 19 200 public String getTimeIn() { 21 return time_in; 22 } 230 public void setTimeIn(String time_in) { this.time_in = time_in; 25} 26@ public String getTimeout() { 27 return time_out; 281 296 public void setTimeout(String time_out) { 30 this.time_out = time_out; 31 } 32 433 public void display () { 34 System.out.println("Time in = "+time_in+" Time out = "+time_out+" Salary deduction = "+salary_deduc+" Salary = "+salary); 35 36 371 J employee.java Salary.java Emp.java X Employees 12 Src (default package) Emp 2 public class Emp{ //main() method start public static void main(String args[]) { 5 //Array String name[]={"abc", "efg", "Imn", "par", "xyz"); 8 1/looping System.out.println("Name of all employee : "); 10 for (int i = 0; i

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions