List Array Java
List Array Java
Emplyoee #1:
Id: 333
Name: Maria Brown
Salary: 4000.00
Emplyoee #2:
Id: 536
Name: Alex Grey
Salary: 3000.00
Emplyoee #3:
Id: 772
Name: Bob Green
Salary: 5000.00
List of employees:
333, Maria Brown, 4000.00
536, Alex Grey, 3300.00
772, Bob Green, 5000.00
Emplyoee #1:
Id: 333
Name: Maria Brown
Salary: 4000.00
Emplyoee #2:
Id: 536
Name: Alex Grey
Salary: 3000.00
List of employees:
333, Maria Brown, 4000.00
536, Alex Grey, 3000.00
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Scanner;
import entities.Employee;
Locale.setDefault(Locale.US);
int n = sc.nextInt();
System.out.println();
System.out.print("Id: ");
int id = sc.nextInt();
id = sc.nextInt();
System.out.print("Name: ");
sc.nextLine();
System.out.print("Salary: ");
double salary = sc.nextDouble();
System.out.println();
int id = sc.nextInt();
if (emp == null) {
else {
emp.increaseSalary(percentage);
System.out.println();
System.out.println("List of employees:");
System.out.println(obj);
sc.close();
package entities;
public Employee() {
this.id = id;
this.name = name;
this.salary = salary;
return id;
this.id = id;
return name;
this.name = name;
return salary;
this.salary = salary;
}