If I have a helper class with static methods, how can I do some initialization best?
public class MyClass {
//init a properties file
{
properties.load(..)
}
public static String getStringFromProperty(String name);
return properties.getProperty(name);
}
}
Is there a better way for initialization than a static code block?
Try it like this…
static initializer blockto initialize the property when the class is loaded.