0% found this document useful (0 votes)
23 views1 page

2.2 Employee

Uploaded by

Crazy Media 7.0
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views1 page

2.2 Employee

Uploaded by

Crazy Media 7.0
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

public class Employee

{
private int employeeId;
private String employeeName;
private double salary;
private double netSalary;
public int getEmployeeId()
{
return employeeId;
}
public void setEmployeeId(int employeeId)
{
this.employeeId=employeeId;
}
public String getEmployeeName()
{
return employeeName;
}
public void setEmployeeName(String employeeName)
{
this.employeeName=employeeName;
}
public double getSalary()
{
return salary;
}
public void setSalary(double salary)
{
this.salary=salary;
}
public double getNetSalary()
{
return netSalary;
}
public void setNetSalary(double netSalary)
{
this.netSalary=netSalary;
}
public void display()
{
System.out.println("Id :"+employeeId);
System.out.println("\nName : "+employeeName);
System.out.println("\nSalary : "+salary);
System.out.println("\nNet Salary : "+netSalary);
}
public void calculateNetSalary(int pfpercentage)
{
double d=salary*pfpercentage*0.01;
setNetSalary(salary-d);
}
}

You might also like