Good Morning All,
I am pretty new to
Java and I have been spending lots of time creating small applications for practice and on one of them, I wanted to have the version appear in many different parts of the gui (login window, title bar, help window, etc). I create a class called StandardText with some static variables marked private. I have pasted some sample code below. I then created some getter methods to retrieve the static variables and then I was sitting here thinking that why do I need the getter methods, the variables are already static, if I mark them public, I will be able to access them direct. My question is two parts:
1) Which way is the better method of practice, private static variables with getter methods that are also static or public static variables with no getter method?
2) Is there are better practice of doing what I am doing?
Thanks,
Mike