I worked with an application that downloads a .properties file using java.util.Properties as follows:
Properties _properties = new Properties(); _properties.load(new FileInputStream("app.properties"));
The properties file (initially) was as follows:
app=myApp dbLogin=myDbLogin version=0.9.8.10 server=1 freq=10000 stateGap=360000
It is strange that when I called _properties.getProperty("app") , it always returned null , however I could load all other properties without any problems. I solved the problem by adding a comment to the top of the properties file, then everything worked fine.
My question is: why does Java do this? I seem to be unable to find documentation about this, and this seems contradictory.
source share