Needing to put some code in one spot, rather than needing to put it in every method I need an instance of it...its not what you are thinking, read on.
Here is the code I am speaking of:
Right now I have to put this in every method and every class I want to use p.SomeMethod() in. So in Class1.Method1 I have to put all that code, and then I can use p.getProperty("measurementProjectsUrl"), or whatever I may need to use.
The problem is, once I pass this project along, someone will have to go in and manually update each and every instance of this code, namely the file path in line four, since it will no longer be on my system. I am wanting to simplify this for that next person, so I need to figure out how to put that code in one spot, and then have a way to create an instance of it where I need it and be able to use the p.getProperty or any other method.
Knowing the little about
java I do, I tried to just put all that code in a class by itself called ConstantClass, and then create an instance of it in another class like so - ConstantClass p = new ConstantClass();
then try to use p.getProperty, etc. To any vet I know this is laughable, and I even knew enough to know this wasn't going to work, but it is a starting point and hopefully can give you guys an idea of what I'm trying to do here.
So, any takers lol?
Would this be an instance of an instance? I'm not sure, thats why i dont know how to handle this