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?
current code;
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();} } }
My Computer
- Computer Manufacturer/Model Number
- Toshiba Satellite L755
- OS
- Windows 7 Home Premium 64bit
- Memory
- 500 GB