Skip to content

Commit 1da222e

Browse files
committed
Change to Auto ID
1 parent de67e3c commit 1da222e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main/java/com/itacademy/CrudEmpleats/domain/Employee.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@ public class Employee {
1010
*
1111
*/
1212

13-
private int id;
13+
14+
private static int id=0;
1415
private String name;
1516
private String job;
1617

1718
public Employee() {
1819
}
1920

20-
public Employee(int id, String name, String job) {
21-
this.id = id;
21+
public Employee(String name, String job) {
22+
id=id++;
2223
this.name = name;
2324
this.job = job;
2425
}

0 commit comments

Comments
 (0)