Is there any difference in when static class member initialisation is done between the following two situations:
(1)
static ArrayList<String> x = new ArrayList<String>();
(2)
static ArrayList<String> x;
static
{
x = new ArrayList<String>();
}
As far as I understand it these are effectively equivalent and both guarantee that x is initialised once and once only, and before any class method or constructor can modify it.