The singleton design pattern is one of the easier ones to un
Solution
public class ConfigParameters {
String fileName = \"CFile.dat\";
int numberOfUsers = 27;
boolean soundOn = false;
private static ConfigParameters instance = new ConfigParameters(); //this cannot be null in a sigleton as it is the only instance that is ever created of the class
private ConfigParameters() {
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public int getNumberOfUsers() {
return numberOfUsers;
}
public void setNumberOfUsers(int numberOfUsers) {
this.numberOfUsers = numberOfUsers;
}
public boolean SoundIsOn() {
return soundOn;
}
public void setSoundOn() {
this.soundOn = true;
}
public void setSoundOff() {
this.soundOn = false;
}
public static ConfigParameters Instance(){
return instance;
}
}
