My main function uses set of hard coded parameters as given in the sample code. Objective: I want a cleaner code instead of hard coding these values inside main. Question: WIs there a way of defining all these parameters in a separate file like a configuration file and enabling access to main? Anybody who wants to change values will be required to modify only the parameter file. If there is a better way of handling the objective, please suggest so.
public class Sample {
public static void main(String[] arg) throws Exception {
BufferedReader File = new BufferedReader(new FileReader("myfile.txt"));
// parameter list
String Parameter_1 = "Value_1";
String Parameter_2 = "Value_2";
.......
//Function code
}