Tuesday, 17 September 2013

Right definition of HashMap for static variables

Right definition of HashMap for static variables

I have trouble with logical definition of the HashMap.
For example I create the following class to store some mandatory data, I
just wanna know that is it good implementation or not? I used static
HashMap because I need these HashMaps all over the time since my
application is alive.
public abstract class DataTable {
private static HashMap<String, String[]> mainData = new
HashMap<String, String[]>();
public static void putData(String[] data) {
// put some data
}
public static String[] getData(String alias) {
// return entered data with the given alias
}
}
Any suggestion would be appreciated...

No comments:

Post a Comment