Skip to content

Commit 0bf021a

Browse files
committed
Correction Auto Id
1 parent 691de28 commit 0bf021a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

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

13-
14-
private static int id=0;
13+
private static int idCount=0;
14+
private int id;
1515
private String name;
1616
private String job;
1717

1818
public Employee() {
1919
}
2020

2121
public Employee(String name, String job) {
22-
id=id++;
22+
this.id=idCount++;
2323
this.name = name;
2424
this.job = job;
2525
}

0 commit comments

Comments
 (0)