I want to return from the static block.
Looks like the return and break statement don't work. Is there any alternative.
I know the bad workaround could be create a flag and check the flag to continue or not.
I understand that the initialisation blocks are not meant for doing computations but just for basic initialisation during class loading.
returncan not be used within an initializer block. JLS 14.17: "[...] It is a compile-time error if a return statement is contained in an instance initializer or a static initializer [...]"