-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathEmployee.java
More file actions
20 lines (18 loc) · 610 Bytes
/
Copy pathEmployee.java
File metadata and controls
20 lines (18 loc) · 610 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
public class Employee {
static String companyName = "TechLearn Institute";
int empId;
String empName;
double salary;
public Employee(int empId, String empName, double salary) {
this.empId = empId;
this.empName = empName;
this.salary = salary;
}
public void displayDetails() {
System.out.println("--- Employee Details ---");
System.out.println("Company : " + companyName);
System.out.println("Emp ID : " + empId);
System.out.println("Name : " + empName);
System.out.println("Salary : " + salary);
}
}