I am writing some test cases using JUnit. I need to initialize some static variables which will be used for all the test cases in that class.

For this I can use either

  1. Static initializer block or
  2. Static method with @BeforeClass

What are the advantages of using one over another?

Edit
Report