public class Bird { private static int id = 0; private String kind; public Bird(String requiredKind) { id = id + 1; kind = requiredKind; } public S
Because the id is static. That means that is a "Class variable/field" and there is only one per Class. All the instances of that Class share it the same id (indeed calling it "id" feels kinda weird).
id
static
See here