Originally posted by Jason:
1) My question is why does compiler not flag an error in the first place since j has not yet been declared when i is to be initialized ?
2) Can anybody can explain to me what is going on here? Exactly what is sequence of execution during initialization?
Jason,
The compiler does not complains for method declared after or before the line it is used. But it complains if it�s related to variables.
1) The variable i is not inicialized but it was declared. The compiler just check for declaration statments. in fact, it is cunfusing but we should note that it is a very poor OOP style. The Compiler help us to write good code but if we do not want ...

2) During inicialization, the sequence is what we would expect for that code. To be clearly, try to change declaring and initialized lines, like this:
private int i = getJ();
private int j = 10; //Here, i = 0
private int j = 10;
private int i = getJ(); //Here, i = 10
So the initialized sequence would not be the broblem.
IMO we should not use something like this. It�s not Object Oriented Programming.