Trying to come up with a good strategy to solve my problem. The problem is I have a final class that contain private constructor and static methods. In order to use any of the static methods I have to initialize an instance of the class. Because I have data in the constructor that the methods need in order to function.
So, why am I making the methods to static? Because 1) the project is so large that i need for example MyClass.AccessThis() and 2) is easier than create an instance and call the method.
EDIT: What i mean with 2) is if i turn all my methods to non-static, public constructor then i can create an instance of the class in any class and use my methods.
EDIT 2: So here it goes.
public final class StackOverFlow {
private static Map<String, String> map = new HashMap<String, String>();
private StackOverFlow() {
map.put("hello", "hello");
}
public static String getHello() {
return map.get("hello");
}
}
I can't obviously get the data if i call the method from an another class by StackOverFlow.getHello(); because the data dont exist.
I am wondering is there any good way to get the data without putting the data in the static method?