how to lose your code with git checkout

This commit is contained in:
ldlda
2024-12-11 07:26:12 +07:00 Unverified
parent 6c9710d6b3
commit 041fc73b24
2 changed files with 5 additions and 34 deletions
+1 -30
View File
@@ -1,35 +1,6 @@
package l2a.employees;
public class Employee {
String ID;
String name;
String department;
int salary;
int bonus_salary;
public Employee (String ID, String name, String department, int salary, int bonus_salary) {
this.ID = ID;
this.name = name;
this.department = department;
this.salary = (salary);
this.bonus_salary = (bonus_salary);
}
public String getID() {
return ID;
}
public String getName() {
return name;
}
public String getDepartment() {
return department;
}
public int getSalary() {
return salary;
}
public int getBonusSalary() {
return bonus_salary;
}
public record Employee(String ID, String name, String department, int salary, int bonus_salary) {
public String funny() {
return ID + " " + name + " " + department + " " + salary + " " + bonus_salary;
}
+4 -4
View File
@@ -74,10 +74,10 @@ public class EmployeeFileRead {
int ind = 1;
for (Employee employee : employees) {
System.out.println("\nEmployee " + ind++);
System.out.println("ID: " +employee.getID());
System.out.println("Name: " +employee.getName());
System.out.println("Department: " +employee.getDepartment() );
double inc = employee.getSalary() + employee.getBonusSalary() * 2.5;
System.out.println("ID: " +employee.ID());
System.out.println("Name: " +employee.name());
System.out.println("Department: " +employee.department() );
double inc = employee.salary() + employee.bonus_salary() * 2.5;
System.out.println("Income: " + inc);
}
}