public class Bird { private static int id = 0; private String kind; public Bird(String requiredKind) { id = id + 1; kind = requiredKind; } public S
Since the id field is static, it will have the same value throughout (and outside of) all instances of Bird.
id
Bird
After creating two Bird objects, the constructor will have been called twice, therefore the id will be 2.
2
See: Understanding Instance and Class Members