Styrow.dev
Question 230 of 247
Java Topic: General medium

Can static block throw exception?

Question

Can static block throw exception?

Answer

Yes, static block can throw only Runtime exception or can use a try-catch block to catch checked exception.