-
Notifications
You must be signed in to change notification settings - Fork 88
Expand file tree
/
Copy pathmain.java
More file actions
34 lines (26 loc) · 1.25 KB
/
main.java
File metadata and controls
34 lines (26 loc) · 1.25 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
package main;
import java.io.FileWriter;
import java.io.IOException;
import java.lang.ref.WeakReference;
public class main {
public static void main() throws IOException {
Employee[] employees=new Employee[10];
employees[0]=new Employee("Yaqut","[email protected]", 20, 3000);
employees[1]=new Employee("Aysun","[email protected]", 20, 3000);
employees[2]=new Employee("Vusale","[email protected]", 20, 20);
employees[4]=new Employee("Nezrin","[email protected]", 20, 2500);
employees[5]=new Employee("Murad","[email protected]", 15, 1500);
employees[6]=new Employee("konbili","[email protected]", 20, 3000);
employees[7]=new Employee("gunay","[email protected]", 20, 30);
employees[8]=new Employee("nihad","[email protected]", 20, 600);
employees[9]=new Employee("emin","[email protected]", 20, 700);
try (FileWriter writer = new FileWriter("employees.txt")){
for(int i=0; i<10; i++){
writer.write("name"+employees[i].getName()+"\n");
writer.write("email"+employees[i].getEmail()+ "\n");
writer.write("age"+employees[i].getAge()+ "\n");
writer.write("Salary"+employees[i].getSalary()+ "\n");
}
}
}
}