Step1 : Create a properties file inside src folder
Step2 : Now go to java program, create a ResourceBundle class object
ResourceBundle a = ResourceBundle.getBundle("config");
Step 3 Access variable value from file using getString method
System.out.println(a.getString("name"));
No comments:
Post a Comment