-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmployeeClass
More file actions
46 lines (39 loc) · 1.32 KB
/
EmployeeClass
File metadata and controls
46 lines (39 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
class Employee{
String name;
int age;
String designation;
double salary;
public void getEmployeeName(String employeeName){
name = employeeName;
//return name;
}
public void getEmployeeAge(int employeeAge){
age = employeeAge;
// return employeeAge;
}
public void getEmployeeDesignation(String employeeDesignation){
designation = employeeDesignation;
// return employeeDesignation;
}
public void getEmployeeSalary(double employeeSalary){
salary = employeeSalary;
// return employeeSalary;
}
public void getEmployeeDetails(){
System.out.println();
System.out.println("Employee name: " + name);
System.out.println("Employee age: " + age);
System.out.println("Employee designation: " + designation);
System.out.println("Employee salary " + salary);
}
}
public class EmployeeTest{
public static void main(String[] args){
Employee employee1 = new Employee();
employee1.getEmployeeName("Joshua Mulaudzi");
employee1.getEmployeeAge(25);
employee1.getEmployeeDesignation("Software Developer");
employee1.getEmployeeSalary(298000);
employee1.getEmployeeDetails();
}
}