Can static block throw exception?

Can static block throw exception?

Yes, static block can throw runtime exception but can't throw checked exception because You do not have any control over the initialization process and static{} blocks cannot be called from your source so that you could surround them with try-catch.

Read More →