I expected that non-static blocks always execute at the time of object creation. But in the following example I called the static method but the non-static block executed. I've not created any object so why does the non-static block execute?
class Example {
static void Mark() {
System.out.println("Mark method");
{
System.out.println("Hello");
}
}
}
public class StaticObject {
public static void main(String[] args) {
Example.Mark();
}
}
Result:
Mark method
Hello