New
#1
Can a property from a .properties file be made into a usable variable?
I have code to read out lines from .properties, but it just prints it out, because im an idiot and didn't notice till now. So, the question is, can it be made into a variable instead?
current code;
And anything wrong with the code while I'm asking?Code:Properties prop = new Properties(); InputStream input = null; try { input = new FileInputStream("config.properties"); prop.load(input); System.out.println(prop.getProperty("CyclesTime")); System.out.println(prop.getProperty("NmbOfCycles")); System.out.println(prop.getProperty("MsgForSave")); System.out.println(prop.getProperty("MsgForRestart"));} catch (IOException ex) {ex.printStackTrace();} finally { if (input != null) { try { input.close();} catch (IOException e) {e.printStackTrace();} } }