what does “this” keyword mean in the initializer block? [duplicate]
This question already has an answer here: In Java, what is the difference between this.method() and method()? 9 answers What does “this” mean? [duplicate] 6 answers Here is my code: class StaticBlock { { println("initializer block : " + message); } public StaticBlock(String message) { this.message = message; } private String message; } Now the issue is that, in the initializer block { println("initializer block : " + message); } if I add the this keyword before message , it works, but there is an error when missing this keyword. And the compiler says: StaticBlockDemo.java:34: illegal forward