I have a question about the following code:
public Class Settings{
public static final String WelcomeMessage= "helloworld";
public static final String ByeMessage= "yo";
public static String[] widgets = {WelcomeMessage,ByeMessage};
}
The compiler complains about duplicat variables. Can I delete the 2 separate variables and still acces WelcomeMessage by Settings.WelcomeMessage? I don't need to acces it by Settings.widget[0]? And is it possible to add another variable to the WelcomeMessage variable (by for instance using a static hashtable)?
Edit: I know this code doesn't look right but it's just an example because I wondered why the compiler thinks WelcomeMessage (as a separata variable) is the same as the variable in the Widgets array.
Settings.WelcomeMessageis "helloworld", whileSettings.widgets[0]is "WelcomeMessage". They are not the same. Maybe you didn't mean to put the double quotes in the widgets array?