I found that what was happening with the following code made my jaw drop out:
public class MCVE {
{
System.out.println(test);
System.out.println(this.test);
}
private final String test = "wat";
}
Line System.out.println(test);gives error
You cannot reference a field before defining it.
But the line is System.out.println(this.test); not
Why is it not a mistake when I qualify it?
source
share