Good Coding Practice

Hello All,

I new to this Forum and as well to Java. I am a learner in Java and want to the best things always. While writing the line System.out.println("Value is" + val); Here I am using the String "Value is" directly in my code itself. When ever in future, if Want to change this string I have to edit the code. Is there any way I can call such type of strings from another file/.java class (this file should contain only such type strings), so that I can edit the value in this file once, which subsequently changes where ever I am calling this string in the code.

This can save a lot of time in searching for a string that needs to be replaced at several places inside Java code. I have seen such things in .NET. Kindly direct me to any Tutorial. An explanation with Example will be more helpful to me.