order of initialization in Java
- by M.H
Hi, I want to ask why java initializes the static objects before the non-static objects ?
in this example b3 will be initialized after b4 and b5 :
class Cupboard {
Bowl b3 = new Bowl(3);
static Bowl b4 = new Bowl(4);
Cupboard() {}
static Bowl b5 = new Bowl(5);
}