A team member has been having trouble with the implementation of his Singleton. Review the code below
Fantastic news! We've Found the answer you've been seeking!
Question:
A team member has been having trouble with the implementation of his Singleton. Review the code below and indicate what changes are required.
public class DataConnectionManager implements JSONSerialization{
private static DataConnectionManager msManager = null;
public DataConnectionManager() {
//Initialize connection
}
public static DataConnectionManager getInstance() {
if(msManager == null) {
msManager = new DataConnectionManager();
}
return msManager;
}
public static void deserialize(JSONObject obj) {
msManager = new DataConnectionManager();
msManager.setFromJSON(obj);
}
}
Posted Date: